I have created settings button in Toolbar
, now I need to navigate the screen to settings screen, when ever i click the settings button.
Try this:
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.your_menu_xml, menu);
return true;
}
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()){
case R.id.action_settings:
//Strar activity here
break;
default:
return super.onOptionsItemSelected(item);
}
return super.onOptionsItemSelected(item);
}