android-contextmenu

Set EditText of Dialog to value of ListView Item onItemLongClick

穿精又带淫゛_ 提交于 2019-12-11 10:59:42
问题 I have a ListView within a Fragment that has a ContextMenu to edit and delete entries. The ContextMenu launches a Dialog on selection of the EDIT option. I'd like to set the EditText 's of that Dialog to the String values of the item selected via onItemLongClick on the ListView , but have been unable to do so. Thanks in advance. Fragment: public static class FragmentS extends Fragment { private ListView saveListView; private List<LiftSave> LiftSaves = new ArrayList<LiftSave>(); private static

Retrieving text from a ListView item with OnContextItemSelected

流过昼夜 提交于 2019-12-10 19:56:36
问题 I've a ListView with a 'classic' context menu with delete and similar options. Since I'm deleting from a SharedPreferences object, I need to retrieve the key, which is the text set into ListView's items. I've tried the following code: @Override public boolean onContextItemSelected(MenuItem item){ AdapterContextMenuInfo saved = (AdapterContextMenuInfo) item.getMenuInfo(); TextView view = (TextView)findViewById((int) saved.id); Log.d("DEBUG:", "before key"); String key = view.getText().toString

Android - Intent that open widget context menu

一世执手 提交于 2019-12-10 15:40:18
问题 in my application I want that when a user click a button the application closes itself and automatically opens the add new widget context Menu. I'm making this: if (viewId == R.id.bt_homeScreen) { finish(); try { Intent intent = new Intent(Intent.ACTION_MAIN); intent.addCategory(Intent.CATEGORY_HOME); startActivity(intent); } catch (ActivityNotFoundException e) { Toast.makeText(this.getApplicationContext(), getResources().getString(R.string.homeClientAlert), Toast.LENGTH_SHORT).show(); } }

Android ListView ContextMenu

拥有回忆 提交于 2019-12-08 03:10:11
问题 I'm trying to create a ContextMenu when user tap hold on an item in my ListView . However my code doesn't show anything when I tap hold on my item. Could somebody please check on my code. Thank you. public class MyD extends SherlockListFragment implements ActionBar.TabListener { private File file; private List<String> myList; private Fragment mFragment; private ListView DLListView; private ArrayAdapter<String> listAdapter; @Override public void onActivityCreated(Bundle savedInstanceState) {

How to show icons in context menu in android?

不羁的心 提交于 2019-12-04 18:30:03
I have a button on my app, when I click that it should display context Menu, But I know we can not show icons in context Menu. I have seen few Apps having icons in their context menu as shown in the link: http://pavansdroidapps.blogspot.com/2011/06/context-menu.html you can create a custom dialog on the click of the button And inflate any layout (with or without images in it) in it using LayoutInflater. http://developer.android.com/guide/topics/ui/dialogs.html#CustomDialog While the API doesn't support icons in Context Menu, but we can always fake it by inflating a Dialog with our own view

contextual action mode in fragment - close if not focused?

筅森魡賤 提交于 2019-12-04 09:31:11
问题 i implemented a contextual action mode bar in a nested fragement. This fragment is part of a view pager and the view pager is also a fragment and part of a navigation drawer. My Problem: I want to close the contextual action mode bar if the fragment is no more focused. So, if I swipe through the view pager the action mode bar should close. But if I use the onPause() method of the nested fragment, the method is not called directly. Often it waits until i swiped two or three times forward...

Enable/Disable item selection at listview in multiple choice mode

末鹿安然 提交于 2019-12-03 14:45:20
I have a listview registered for context menu in multiple choice mode: private void initListViewForContextMenu(){ log.d("FilesFragment", "initListViewForContextMenu()"); ListView listView = getListView(); listView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE_MODAL); listView.setMultiChoiceModeListener(new MultiChoiceModeListener() { ... The problem is that not all the items of my view should be selectable, only those showing a special icon should be available for selection. I don't know how to implement this, I've defined an OnItemLongClickListener : getListView().setOnItemLongClickListener(new

contextual action mode in fragment - close if not focused?

佐手、 提交于 2019-12-03 07:55:23
i implemented a contextual action mode bar in a nested fragement. This fragment is part of a view pager and the view pager is also a fragment and part of a navigation drawer. My Problem: I want to close the contextual action mode bar if the fragment is no more focused. So, if I swipe through the view pager the action mode bar should close. But if I use the onPause() method of the nested fragment, the method is not called directly. Often it waits until i swiped two or three times forward... Here are some pictures: In the second picture you can see that the action mode bar is still there. So my

Customise context menu like pinterest menu

ε祈祈猫儿з 提交于 2019-12-03 07:42:32
问题 I've been looking for something like Pinterest menu whenever item in GridView is pressed. I know it's too broad question. But little strike on question will provide a correct way to achieve these. Que: How one can implement customise context menu like Contacts+ or Pinterest Context menu on GridView item? Tried: ArcMenu : But they are replacement of Slider Menu or Pop up Menu for overall Application. I want menu which can be created onFly for GridView Item. Satellite Menu : Same as ArcMenu,

How to open Menu Context Android with click button in listview adapter?

风格不统一 提交于 2019-12-03 04:10:57
How to open Menu Context Android with click button in listview adapter ? I tried with my code, but not show the menu context, code public View getView(int position, View convertView, ViewGroup parent) { vi=convertView; if(convertView==null) vi = inflater.inflate(R.layout.tulisan_komentar_list_item,parent, false); LinearLayout content_favorite= (LinearLayout)vi.findViewById(R.id.content_favorite); final TextView date_komentar = (TextView)vi.findViewById(R.id.date_komentar); // artist name final TextView isi_komentar = (TextView)vi.findViewById(R.id.isi_komentar); // duration final TextView nama