[SOLVED]
When trying to run/debug the program, I get "simple_list_item_1 cannot be resolved or is not a field".
I've imported the necessary packages and I have to agree with the error since my R.java somehow doesn't include a variable like 'simple_list_item_1'. Neither has this been mentioned in the example.
I'm left wondering how the program recognises the android simple_list_item_1 when there's no reference or import to it? (I've just started with android, coming from mobile 6.5 with C# and am trying to get a feel for the differences between the two.)
used imports:
Code:
import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnKeyListener;
import android.widget.ArrayAdapter;
import android.widget.EditText;
import android.widget.ListView;
my R.java looks like this;
Code:
package mypackage.todolist;
public final class R {
public static final class attr {
}
public static final class drawable {
public static final int icon=0x7f020000;
}
public static final class id {
public static final int myEditText=0x7f050000;
public static final int myListView=0x7f050001;
}
public static final class layout {
public static final int main=0x7f030000;
}
public static final class string {
public static final int app_name=0x7f040001;
public static final int hello=0x7f040000;
}
}
note: EditText and ListView were added to main.xml. I've also already added the onKeyListener.
Anyone know what I'm missing?
EDIT:
It seems that the reference to R should've been Android.R. I was thinking too much and changed that which made the program go awry. Should be ok now, although I'm still getting a fatal error on startup in the emulator, but atleast this's been solved.
Regards,
Djanello.