I'm using action bar in my application and I want when the user clicks a button, the item in action bar should change text.
This is my code for onOptionsItemSelected()
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.action_refresh:
Toast.makeText(this, "Menu Item 1 selected", Toast.LENGTH_SHORT)
.show();
finish();
break;
case R.id.lg:
Toast.makeText(getBaseContext(), "ma", Toast.LENGTH_SHORT).show();
break;
case R.id.French:
Toast.makeText(getBaseContext(), "zaki", Toast.LENGTH_SHORT).show();
break;
case R.id.nerlandais:
Toast.makeText(getBaseContext(), "brahim", Toast.LENGTH_SHORT)
.show();
}
return true;
}
What must I do to add to change the item title from another item.
Example: When I click in French item I want to change nerlandais item title.
.
stackoverflow.comm
No comments:
Post a Comment