October 27th, 2010, 12:38 PM
|
#1 (permalink)
|
|
New Member
Thread Author (OP)
Join Date: Oct 2010
Posts: 3
Device(s):
Carrier: Not Provided
Thanks: 1
Thanked 0 Times in 0 Posts
|
Change Activity via Options Menu
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.
|
|
|