android-contextmenu

Get Table Row data in the ContextMenu

我们两清 提交于 2021-01-29 08:28:35
问题 Well so I've been struggling for a while now to figure this out browsing through posts but I haven't yet come across anything viable. This is a part of my code for the table: TableLayout flightInfoTable = (TableLayout) findViewById(R.id.flightInfoTable); flightInfoTable.setStretchAllColumns(true); flightInfoTable.setShrinkAllColumns(true); for (int i = 16; i < flightInfoArrayLenght - 1; i++) { TableRow rowFlightInfo = new TableRow(this); rowFlightInfo.setGravity(Gravity.CENTER); rowFlightInfo

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

眉间皱痕 提交于 2020-01-12 03:49:06
问题 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

Enable/Disable item selection at listview in multiple choice mode

点点圈 提交于 2020-01-01 05:22:04
问题 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

Context menu in GridView Android

最后都变了- 提交于 2019-12-25 02:31:14
问题 I have GridView : GridView gridView = (GridView) findViewById(R.id.grid_view); // Instance of ImageAdapter Class final String [] imageNames = {"knee_kg","knee_ks","knee_kp","knee_kg_90", "pipe_knee", "cover", "funnel", "crater"}; Integer[] mThumbIds = new Integer[imageNames.length]; for (int i = 0; i<imageNames.length; i++){ Integer resID = getResources().getIdentifier(imageNames[i], "drawable", getPackageName()); mThumbIds[i] = resID; } and OnItemCliclListener : gridView

Android: RecyclerView item Contextmenu issue

柔情痞子 提交于 2019-12-23 19:12:19
问题 I am trying to implement a RecyclerView, that each item when clicked, a context menu will pop up. I have referred the answers/comments from this question on how to to do what I wanted. My problem is, I keep getting null by using getMenuInfo() to retrieve info. Ie, When I select an item from the context menu, this is what I get java.lang.NullPointerException: Attempt to read from field 'long com.x.lib.RVCoursesContextMenu$RecyclerContextMenuInfo.id' on a null object reference My code for this

Item title not displayed in portrait with SHOW_AS_ACTION_WITH_TEXT

浪尽此生 提交于 2019-12-23 15:34:46
问题 In my activity, I have an action mode with a single item which has a title and an icon. I want both the title and the icon to be displayed, so I use SHOW_AS_ACTION_WITH_TEXT and SHOW_AS_ACTION_ALWAYS flags. In landscape orientation, it's fine. I have title + icon. But in portrait orientation only the icon is displayed (though there's a lot of free space). Does anyone know what I could do to fix it ? Note that the title is correctly displayed if I remove the icon. Here is my sample code:

How to show icons in context menu in android?

谁说胖子不能爱 提交于 2019-12-13 12:19:33
问题 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 回答1: 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 回答2: While the

Android error in passing id of selected item in listview using ContextMenu

为君一笑 提交于 2019-12-13 06:27:44
问题 I have a listview and long pressing will show contextmenu update, delete and send prescrip. Now when i click update it will go to the EditPatientActivity. Populate all data from MySql database to the form. My Problem is when i click the update menu it crashed the application. I don't know why. Please help me. I don't know if the problem is in passing the uid or something is missing from the EditPatientActivity. edit_patient.xml <?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android=

Opening a floating menu (context menu) in Android?

蓝咒 提交于 2019-12-12 11:18:16
问题 I created a new menu, named drmenu.xml. It works correctly when i press menu button, but I need to open a context menu when the user press the button. The below code the button just show a toast. this is my xml layout: <LinearLayout android:id="@+id/MenuCall" android:layout_width="90dip" android:layout_height="match_parent" android:gravity="right|center_vertical" > <ImageView android:id="@+id/MenuCall" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="

Need help to delete selected item from listview

℡╲_俬逩灬. 提交于 2019-12-12 06:17:51
问题 I want to delete a selected item from the list view; actually I want to perform this operation from the context menu. Everything is going fine but I'm not able to delete that item. Please give me some suggestions or examples to remove item from the listview 回答1: I have used like this in my code, it can delete multiple items from the list ListView lv_ArchivePartylist; ArrayList<Parties> select_archived_party; lv_ArchivePartylist = (ListView)findViewById(R.id.archive_ListView01); lv