Hi,
Im new on Android, and im trying to start an Activity from a MenuItem choose of the user.
Actually, im building my menu (and is working ok) from my main activity class using a MenuInflater:
@Override
public boolean onCreateOptionsMenu(Menu menu)
{
super.onCreateOptionsMenu(menu);
//the Menu Inflater class allows to create a menu from a XML File
MenuInflater inflater = new MenuInflater(this);
inflater.inflate(R.layout.menutest,menu);
return true;
}
And im handling the Menu selection using the following code (working fine too):
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId())
{
case R.id.MenuItemNewWebsite:
ShowScreenAddSite();
break;
default:
break;
}
return false;
}
I have a second and last activity called AddWebsite, and i would like to start it, but the following code doesnt work:
protected void ShowScreenAddSite()
{
Intent i = new Intent(AddWebsite.class);
startActivity(i);
}
Do you know what is the extra thing that i have to pass to the Intent constructor? Thanks in advance. Best Regards. Jose