How do I view Cut, Copy, Select All, and share options in the action bar?

advertisements

I seen some of the applications like gmail and other apps in which where there's an editText and textView while clicking on text long press i can see in the actionbar there's menu appear say cut, copy, select all ,share and lookup option appears.

This same behavior as a developer wanted to include in my application.

How can I achieve this?


Check this tutorial which will help you to create contextual actionbar

Reference : Tutorial : Contextual Action Bar (CAB) - Android
Code : GitHub : Contextual Action Bar (CAB)

Edit

In your EditText layout, add below property to show standard Android contextual menu for copy/paste.

android:textIsSelectable.

Check this tutorial as well.