Hi,
I`ve encountered a really strange problem. Propably some of you already saw that piece of code before (it`s out of a popular book):
So what`s the problem you ask? Well, the debugger acts really strange and return an IndexOutOfBounds error on the ListView. The lines are also really weird and it looks like an inside error. Displayed below.
Can anyone help and say what am I doing wrong? I`m really clueless now :/
I`ve encountered a really strange problem. Propably some of you already saw that piece of code before (it`s out of a popular book):
Code:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.menu);
ListView menuList = (ListView) findViewById(R.id.listViewMenuItems);
String[] items = { getResources().getString(R.string.locate_menu_item) ,
getResources().getString(R.string.settings_menu_item),
getResources().getString(R.string.help_menu_item)};
ArrayAdapter<String> adapt = new ArrayAdapter<String>(this, R.layout.menu_item, items);
menuList.setAdapter(adapt);
}
So what`s the problem you ask? Well, the debugger acts really strange and return an IndexOutOfBounds error on the ListView. The lines are also really weird and it looks like an inside error. Displayed below.
Can anyone help and say what am I doing wrong? I`m really clueless now :/