I need my app can show text selection toolbar after I click on a menu bar. I mean when I choose an item on menu bar may be like this Menu Bar, after that my device will appear Text Selection Toolbar like this Text Selection Toolbar
Is it possible to do that? Please help me. Thank you. This is my code
@Override
public boolean onCreateOptionsMenu(Menu menu) {
super.onCreateOptionsMenu(menu);
// Inflate the menu; this adds items to the action bar if it is present.
//add(groupId, itemId, order, name)
menu.add(1, 1, 1, "Copy Text");
menu.add(1, 2, 2, "Exit");
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml
case 1:
//Show text selection toolbar
case 2:
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_HOME);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
return true;
default:
break;
}
return super.onOptionsItemSelected(item);
}