My EditText is not displaying the default ContextMenu (copy, paste, select, selectall) after a long press. Do I have to create my own ContextMenu?
Below is snippets from a function that is called to create a popup menu where this EditText resides.
LayoutInflater layoutInflater = (LayoutInflater) getBaseContext().getSystemService(LAYOUT_INFLATER_SERVICE);
popupView = layoutInflater.inflate(R.layout.add_recipe_pop,null);
final PopupWindow popupWindow = new PopupWindow(popupView,LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT);
EditText recipe_url = (EditText)popupView.findViewById(R.id.recipe_url_text);
recipe_url.setLongClickable(true);
registerForContextMenu(recipe_url);
popupWindow.setFocusable(true);
popupWindow.update();
popupWindow.showAtLocation(v,Gravity.CENTER,0,0);
This is part of the add_recipe_pop XML and the EditText is just in a
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#E6E6E6"
android:orientation="vertical" >
<EditText
android:id="@+id/recipe_url_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="@string/add_recipe_hint"
android:inputType="textUri"
/>
I have tried toying with the EditText focusable and setTextSelectable attribute but the keyboard doesn't appear if I do. Thank you for your help! :)