Ok,I’m creating an application that has a menu, and there are three menu items on is about one is to go to a webpage and one to exit the application.
The exit and about work fine but the webpage menuitem doesnt work, it force closes here is my code for the menus:
public boolean onCreateOptionsMenu(Menu menu){
super.onCreateOptionsMenu(menu);
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.main_menu, menu);
return true;
}
public boolean onOptionsItemSelected(MenuItem item){
switch (item.getItemId()){
case R.id.about:
startActivity(new Intent("com.example.ABOUT"));
return true;
case R.id.facebook:
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("www.facebook.com"));
startActivity(browserIntent);
return true;
}
return false;
}
Could someone tell me whats wrong?
use like this