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.

Android :: Open Context Menu for Specific Item of List


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 :: 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 :: 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 : 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 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 :: 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.

View 1 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 :: Customize List View Context Menu Colors

Nov 15, 2010

I need to change the colors and/or style of the ContextMenu when I long press an item of a ListView.I've looked everywhere for an answer and cannot find anything related to ContextMenu customization.

View 1 Replies View Related

Android :: Registering Context Menu For Custom List Adapter

May 11, 2010

made a custom list adapter extending the Base adapter. Each item in the list has an imagebutton, 2 textviews and a button. I tried to add the context menu to the list so as to display some options for an item in the list. registerForContextMenu(getListView()); I used a MenuInflater object to inflate the context menu xml file. But on clicking the items in the list nothing shows up or the usual highlighting of the item of list on click isn't shown. Is it that the context menu doesn't work for custom list views? Any help would be much appreciated.

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 :: Context Menu In List Activity - When Make Long Press

Oct 18, 2010

I have list activity with custom array adapter and I can't to get context menu when make long press on list item.

<TabWidget
android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content"/>
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="5dp">
<ListView
android:id="@+id/list"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
Why I do not see context menu? What I do wrong? How to get context menu with array adapter and ListActivity.

View 1 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 :: 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

General :: Chrome Long-press Context Menu Stopped Working - Can't Open In New Tab

May 18, 2013

I have a Nexus 4 running stock JB 4.2.2.

At some point (not sure when exactly) the long-press feature to bring up the context menu for links in Chrome stopped working.

When I long-press on a link, all that happens is I get a short vibrate, but no menu.

This means that I can no longer "Open in new tab".It's all working fine on my Nexus 7.

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 :: Find Item In List Without Filtering List But Just Scrolling To That Item

Oct 17, 2010

Trying to implement simple dictionary. I want to make it so while the user is typing in the EditText box the list to scroll automatically to the best match. I don't want it to filter the list. For example if the user types "s" in the EditText I want the first word that s/he sees under the EditText box to be the first word in the dictionary that starts with "s." But the user should still be able to slide up and down and to be able to see the entire list of words. It is basically like a go to functionality. I used ArrayList to store my list of words. The data is in res/raw/data.xml file. Here is my onCreate method
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
wordListView = (ListView)findViewById(R.id.wordList);
myEditText = (EditText)findViewById(R.id.myEditText);
words = new ArrayList<Word>();
arrAdap = new ArrayAdapter<Word>(this, android.R.layout.simple_list_item_1, words);
wordListView.setAdapter(arrAdap); try {
InputStream inSource = getResources().openRawResource(R.raw.data);
DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
Document doc = builder.parse(inSource, null);
NodeList wordsList = doc.getElementsByTagName("eng-bg");
int length = wordsList.getLength();
for(int i = 0; i<length; i++) {
Element entry = (Element)wordsList.item(i);
Element eng = (Element)entry.getElementsByTagName("english").item(0);
Element bul = (Element)entry.getElementsByTagName("bulgarian").item(0);
Element id = (Element)entry.getElementsByTagName("ID").item(0);
String english = eng.getFirstChild().getNodeValue();
String bulgarian = bul.getFirstChild().getNodeValue();
int wordId = Integer.parseInt(id.getFirstChild().getNodeValue());
Word word = new Word(bulgarian, english, wordId);
addNewWord(word);
} catch (ParserConfigurationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (SAXException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}wordListView.setOnItemClickListener(new OnItemClickListener(){
public void onItemClick(AdapterView<?> parent, View view, int pos, long id) {
selectedWord = words.get(pos);
showDialog(TRANS_DIALOG);
myEditText.setText(selectedWord.getEnglish());
myEditText.addTextChangedListener(new TextWatcher(){
public void onTextChanged(CharSequence s, int start, int before, int count) {
@Override
public void afterTextChanged(Editable s) {
// TODO Auto-generated method stub
@Override
public void beforeTextChanged(CharSequence s, int start, int count,
int after) {
// TODO Auto-generated method stub

View 1 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 :: 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 :: How To Scroll Up When Choose Some Item At Item List?

Nov 20, 2010

I jave a list of item (linearlayout inside a scrollview where i add buttons vertically to linearlayout dynamically from the java code)i need when i click on one button the item moves up (scroll up) , to make the item at the first of the screen

View 1 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 :: On Context Item Selected Does Not Respond

Mar 13, 2010

I am creating a context menu in separate class from the listview, because the contextmenu will be access by several listviews in different classes. Whenever I long-click the listview, contextmenu pops up, but nothing happens when the options were chosen. Tried to look at logcat message and it said something like this:

Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@43c488f8

Any idea what really causing this problem? cause it works perfectly fine if i put the contextmenu on the same class as listview.

View 13 Replies View Related

Android :: Way To Present List To User Where Each Item On List Starts An Activity When Selected

Nov 4, 2010

I am on my first Android application and I am on a timeline so details and examples will be useful since my knowledge is still minimal. I want my first screen to present the user with a list of activities to choose from. In my situation it is a recipe app where the user first chooses the type of food, such as, Beef, Chicken, or Pork. I want the application to launch an activity depending on the list item that the user clicked on. I am not sure if I should use a list view, a text view, a scroll view, a list activity, an activity group...

View 1 Replies View Related







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