• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Change Activity via Options Menu

gorjan

Lurker
Hi All,

I'm really new to Android development, so I have one basic question.
I have the following code. I want to change the screen(the Activity) via Options menu:

Code:
@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		// TODO Auto-generated method stub
		switch (item.getItemId())
		{
		case R.id.item01:
			Intent intentItem1 = new Intent(this, Item1Activity.class);
			startActivityForResult(intentItem1, 0);
			//startActivity(intentItem1);
			return true;
			
		default: return super.onOptionsItemSelected(item);
		}
		
	}

But the activity doesn't change and the error message I receive while debugging is that "The resource doesn't exist"

Any ideas?

Thanks in advance.
 
Welcome to the Android Forums community! Glad you signed up! Please feel free to join the conversations! If you need any help getting around, please PM me and I'll try to help! :D
 
Back
Top Bottom