Android :: Event Which Called When A User Click On Disabled Item In Context Menu?

Oct 28, 2010

I have button, which displays a Context menu. In the menu are few items (some of them are disabled - setEnabled(false)).

Which event is called when a user click on the disabled item? It's not onContextItemSelected nor onContextMenuClosed. But the menu is closed after the click.

Android :: Event which called when a user click on disabled item in context menu?


Android :: Contributing Menu Item To The Contact List Context Menu

May 23, 2010

I want a user to be able to long press a contact and be offered a menu item of my own that can run an activity of my own. You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscribe@googlegroups.com For more options

View 3 Replies View Related

Android :: Make Menu Item Disabled

Jan 14, 2010

Is it possible to disable (gray) a menu item?

View 3 Replies View Related

Android :: Add New Item In SMS Context Menu

Nov 12, 2010

Can I add a new item in SMS context menu which can in turn invoke my app/activity?

View 2 Replies View Related

Android :: How To Add Item To Hyperlink Context Menu

Oct 6, 2009

when you long click a hyperlink of browser, you will see a context menu with 'Open, Open link in new browser, Browser Link, etc'.

is it possible to add some customized item to the context menu?

View 3 Replies View Related

Android :: Add Item To Hyperlink Context Menu?

Dec 4, 2009

Does any one know how to add item to hyperlink context menu? This is a question that as already been posted here, but I didn't found any solution, and it is really useful.

View 2 Replies View Related

Android :: Remove An Array Item From A Context Menu?

Aug 27, 2010

I have a ListView and would like to remove a row item when the user long clicks on selects Remove from the context menu.

CODE:..................

How can I get a reference to the row number that was clicked, so I can remove that index from my array?

View 1 Replies View Related

Android :: Adding Item To Global Context Menu

Feb 18, 2009

When you long press on something in Android, a context menu comes up.I want to add something to this context menu for all TextViews in the system.For example, the system does this with Copy and Paste. I would want to add my own, and have it appear in every application.

View 3 Replies View Related

Android :: Prevent Context Menu From Closing On Clicking Item

Feb 25, 2010

If I have a checkable item in a Context Menu or ordianry Menu, how do I prevent the menu from closing when the item is selected?

View 2 Replies View Related

Android :: Open Context Menu For Specific Item Of List

Jul 17, 2009

I am using openContextMenu() when someone clicks on an item of a list (not when they long press as usual). The context menu does appear, however, it shows the context menu for the last item that the context menu had appeared. For example, if I long press the item C of the list then the context menu for item C appears, and later if I click on item B, with openContextMenu() the context menu for item C will again appear, not for B that I was expecting. How can I set the current item for which the context menu will appear to be the item of the list the user clicks on? I do have the position from onListItemClick() and I was trying to find a call like setContextMenuItem() or something, but I can't find anything.

View 7 Replies View Related

Android : Check Value To Disable / Enable Context Menu Item?

Aug 27, 2009

In my application has a ListView. When long press on item the "Context Menu" will appear. I want to check the data ID, then set disable/enable to my Context Menu "Items". I can not find out the function like getMenuInfo() or something like this.

@Override
public void onCreateContextMenu(ContextMenu menu , View v, ContextMenuInfo menuInfo)
{ super.onCreateContextMenu(menu, v, menuInfo);
menu.add(0, ADD_FAVORITE_ID, 0, "Check");
menu.add(0, ADD_FAVORITE_ID, 0, "UnCheck").setEnabled(false);}

View 1 Replies View Related

Android :: Invoke Android Context Menu On Menu Item Press

Nov 9, 2010

Can anyone kindly guide as to how can I invoke a context menu on the press of a menu item. I googled a lot for the same, but nothing turned up. Look forward for your valuable help.

View 1 Replies View Related

Android :: Context Menu Long Press And OnTouch Event Conflicting

Oct 26, 2010

I have a situation where I have some textview on a framelayout that I have a onTouch event wired in order to simulate dragging. I alos want to enable the ability to have a context menu display when the user long presses the textview. Now that I have implemented the context menu functionality dragging no longer works since the longpress is always served by the context menu event.Does anyone know of a workaround for this.

View 2 Replies View Related

Android :: Context Menu On Table Layout How To Get Selected Item Position?

Jan 22, 2010

Context Menu seems quite handy as long as we are using an AdapterView as we can easily get selected item position in onContextItemSelected from AdapterContextMenuInfo.position Any idea how we can achieve something similar in a TableLayout? In my TableLayout, i have some TableRow and i would like to get the row index in the onContextItemSelected callback like i would do with a simple ListView. I guess i will have to register the contextmenu for each row? but how can tie the row index with the menu? i see no way to do it with registerForContextMenu.

View 2 Replies View Related

Android :: Context Menu Title Get From Clicked List View Item

Sep 16, 2010

Trying to set ContextMenu title according to the ListView clicked item.The ListView contains Bookmarks list -> FAVICON + BOOKMARK TITLE @Override public void onCreate Context Menu (Context Menu menu, View v, ContextMenuInfo menuInfo) {super.onCreateContextMenu(menu, v, menuInfo); menu.add(0, EDIT_ID, 0, R.string.menu_edit); menu.add(0, DELETE_ID, 0, R.string .menu_delete); menu.add(0, SHARE_ID, 0, R.string.menu_share); AdapterView. Adapter ContextMenuInfo info = (AdapterView.AdapterContextMenuInfo)menuInfo; View itemID = (info.targetView); menu.setHeaderTitle("bla" + itemID);when I run this code it shows the android.widget.RelativeLayout@423d2389 or whatever and if I change the itemID to String itemID = ((TextView) info.targetView).getText().toString(); I get force close on long click even though no errors are shown in Eclipse or when I run the app.I also want to get the favicon in the same way.

View 1 Replies View Related

Android :: How To Implement Context Menu On Key Press Instead Of Long Click / Tap?

Jun 5, 2010

I have a ListActivity and I want to implement context menu for each of the list elements. I know that the common way to do this is to show the context menu on long click/tap. I want to know if there is a way to show the context menu for each element on a key press(preferably the menu key).To rephrase my question, how can I trigger the context menu and not the options menu by pressing the menu key(or any other key).

View 2 Replies View Related

Android :: Best Practice For Opening Context Menu - Like From Short Button Click?

Oct 1, 2010

I have a button that says "Sort" and when a user normal/short presses the button, I want a menu to appear with the various sort options. Looking around online there doesn't seem to be a straight forward answer to which route is considered best practice. I'm looking to have a menu that looks similar to this: For an example, click the Layers button in the Google Maps app. It opens a list of options on a single short click. It has a title at the top and icons for each option. (The icons aren't super crucial) Should I use a Context Menu? If so, how do I do it without a long press. Should it be a Spinner? If so how do I change the appearance to use a button instead of the normal drop down box.

View 2 Replies View Related

Android :: Android - Keeping Options Menu Open After User Clicks On Menu Item

Nov 19, 2010

I have an Options menu up and running in my Android application and I've overridden the onCreateOptionsMenu, onOptionsItemSelected and onPrepareOptionsMenu methods to customize the menu a little. My question is related to keeping the Options menu open after the user clicks on a menu item. Basically, I'd like to be able to hide the menu until the user clicks on the device menu key. Once the user clicks on this key, I'd like to be able to hold the menu in place regardless of how many times the user clicks on menu items. If the user wants to hide the Options menu, they'd just need to click on the device menu key again. Is this type of interaction supported (or even advisable).

View 1 Replies View Related

Android :: List View Context Menu And OnItem Click Listener Not Working

Sep 9, 2010

I have a tab activity with three tabs and I want to display a listview in each tab. The list populates correctly, but for some reason I can not get the context menu or itemclicklistener to recognize gestures on the listviews. Anyone have any ideas why this might be? Below is my onCreate method: @Override public void onCreate(Bundle savedInstanceState) { super. onCreate (savedInstanceState);setContentView (R.layout.armory_header); TabHost mTabHost = getTabHost(); mTabHost.addTab (mTabHost. newTabSpec ("1"). setIndicator ("Weapons"). setContent (R.id.page1)); mTabHost.addTab (mTabHost.newTabSpec("2").setIndicator( "Armor" ).setContent(R­.id.page2))TabHost.addTab(mTabHost.newTabSpec("3").setIndicator("Accessories"). setCon­tent (R.id.page3)) ; weapons = (ListView) findViewById(R.id.weaponlist); registerFor ContextMenu(weapons) ;weapons.setOn ItemClickListener (new OnItemClickListener(){ @Override public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {// TODO Auto-generated method stub listId = weapons.getId(); position = arg2; showDialog (DIALOG);armor = (ListView) findViewById (R.id.armorlist) ;register ForContext Menu(armor); armor.setOnItemClickListener(new OnItemClickListener(){ @Override public void onItem Click(AdapterView<?> arg0, View arg1, int arg2, long arg3) { // TODO Auto-generated method stub listId = armor.getId();position = arg2; showDialog(DIALOG);

View 2 Replies View Related

HTC Desire :: Browser Long Click - Context Menu Or Select Text

Aug 20, 2010

While browsing, I often like to open a linked page in a new window, so do this via long pressing the link. However, it seems to me to be totally random whether long pressing a link brings up the context menu (which is what I usually want), or goes into text selection mode.

How do you control over which of these two actions occurs when long pressing a link?

View 1 Replies View Related

Android :: Hide Android Context Menu Item

Nov 18, 2010

I have a context menu that I apply for a ListView that simply allows the user to move items up or down, or delete the item.

I have code in onContextItemSelected() to prevent things from moving up past top or bottom of the list, etc., but I'd rather hide the context menu items in the first place if (for instance) the top item in the list is selected.

I assume that I need to do this in onCreateContextMenu, but I'm not sure how.

Here is my onCreateContextMenu code:.....................

View 2 Replies View Related

Android :: Cant Find Item For Context Menu / Change "Add To Favorites"

Oct 22, 2009

Can someone please help me find which item was long clicked in this method i need to determine which item was clicked so that if it is a favorite or not already i can change the "Add to Favorites" accordingly. Code...

View 3 Replies View Related

Android :: Launch Context Menu From Context Menu

Jan 21, 2010

How can I launch a contextmenu from a contextmenu? I'm trying to replicate the MediaPlayer action that happens when you long click a song, then click "Add to playlist" in the resulting contextmenu. When you click that menu item, another contextmenu pops up with "Add to playlist" as the title, and "Current playlist", "New", and however-many-playlists-you-have defined after that.

View 4 Replies View Related

Android :: Menu Item Separetor (menu Item In Different Line)

Jun 2, 2010

How can i define each menu item in different line? Right now if I'm adding 4 items they will get the form of 2X2. Is there a way to add them differently? Like 1 item and 3 below it? or 1X4?

View 1 Replies View Related

Android :: Click In List View Item Changes Status Of Elements Inside Item?

Apr 9, 2010

I don't know exactly how to explain this problem, but I'll try. I have a ListView with several items. Each item has inside a TextView and two ImageView. I want the ImageView change when I click on them, and I want to open a context menu when I press for a long time into the ListView item.For the ImageView, everything works properly. For the whole item, I can show the context menu after a long press, but my problem is that the ImageView changes as well when I am pressing the TextView, for example.I hope you understand my problem. I think that all the children of a view are affected by an event in the parent, but I am not sure.

View 2 Replies View Related

Android :: ListView Selection - Make Only Item Click Be Effected By Click?

Apr 1, 2010

when I click on one item in the ListView that item's background changes to light gray, but when I continue to scroll through the list every 4th item has the background changed to light gray even though those other items have not been clicked. How do I make only the item I clicked be effected by the click?

ListView lv = (ListView) findViewById(R.id.resultsList);
lv.setAdapter(new ArrayAdapter(this, R.layout.resultitem, (String[])labelList.toArray(new String[labelList.size()])));
lv.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView parent, View view, int position, long id) {
TextView tv = (TextView)view.findViewById(R.id.result);
tv.setBackgroundColor(Color.LTGRAY);
tv.setTextColor(Color.BLACK);

View 1 Replies View Related

Android : LongClick Event Also Triggers Click Event

Apr 12, 2009

I use onLongClick and onClick events of a button to get user inputs. Whenever; the user long click and triggers onLongClick event, the onClick event is also triggered. I couldn't find my problem. The code of two methods are shown in below: Code...

View 2 Replies View Related

Android :: Adding Menu Items In WebView Context Menu

Mar 8, 2010

I'm trying to add custom menu items in a WebView Context Menu. Unfortunately, my items are shown in the menu of the first web page I load , but then if I load a second page, a long press only shows the standard context menu items. Mine are gone. I've put a Toast inside the code and it is displayed as well on the first loaded page, but not on the second. I'm using the code below:..............

View 6 Replies View Related

Android :: Adding Menu Item To Any Text Box Menu

Sep 10, 2010

Is it possible to add a custom menu item to the long-press menu that opens in any text box?

View 3 Replies View Related

Android :: How To Create ListView Disabled Item Labels For Sections?

Jul 27, 2010

I have a customized Cursor based adapter for my ListView. Each Cursor has a few columns of data, sorted by the priority column. I know you can create a disabled list item to act as a sort of header, like in the Market app (the little green labels). What I would like to do is display a header for each group of items with a different priority. They are already sorted by priority. Example data:
title, priority
note1, high
note3, high
note2, low
note4, low

Example of what I want in ListView:
= High Priority =
-note1
-note3
= Low Priority =
-note2
-note4

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved