Android :: Use Long Press ListView Item To Open AlertDialog?

Dec 10, 2009

I am trying to use the long press option on the listview items to open a multi choice Alert Dialog. Is this possible?

ADVERTISEMENT

Android :: How To Pass Selected Item's ID From A ListView To An AlertDialog

Jul 20, 2009

I have a ListActivity, and long-pressing on an item brings up a context menu. One item in the context menu is "delete", and that brings up a confirmation box (and AlertDialog). When the user presses OK in the confirmation dialog, I need to know the ID of the item that was originally selected, so that I can actually delete it.

The flow looks like this:

This event: Causes Android to call:
-----------------------------------------------------
Long press an item -> onCreateContextMenu()
Select context menu item -> onContextItemSelected()
call showDialog()-> onPrepareDialog()
user clicks OK -> onClick()

In onCreateContextMenu and onContextMenuSelected, I can get at the id of the selected item from the ContextMenuInfo. In onPrepareDialog, however, I no longer have access to that information. The rub is that onPrepareDialog needs this information to set up an onClick listener on its POSITIVE button.

I know that, during onContextMenuSelected, I can stash the selected item's ID away into a field of my activity. I have done that, and it works. But it's also really ugly. The statefulness that it introduces makes me uneasy. Has anybody else seen a better way to pass such information around than to use fields in the activity?

View 3 Replies View Related

Motorola Droid X :: Yahoo Mail On 2.2 - Unable To Long Press And Open The Link

Sep 28, 2010

If I receive a link in an email on my yahoo account I am unable to long press and open the link? Is this a known bug?

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

Motorola Milestone :: Long Press Search Doesn't Work With Hardware Keyboard Open

Jun 30, 2010

On my UK Milestone (rooted), long press on the search button only works when the hardware keyboard is shut, when the keyboard is open, long press works the same as a short press.

While looking for a fix for this, I found very little information on the net, so I'm wondering if it's a problem with only selected devices. Can anyone confirm for me if theirs works or not?

I have OpenSearch assigned to long press search, and since I always use the hardware keyboard, I need to close it, long press search, then open the keyboard. It's annoying.

I've looked at editing the qwerty.kl file in /system/user/keylayout, my idea was to try to redefine to search key on the keyboard (between left alt and @) to launch OpenSearch, but it apears that I can only redefine keys to other keys that way, not launch apps.

View 3 Replies View Related

HTC EVO 4G :: Cant Long Press On Evo?

Jun 29, 2010

i exchanged my phone today do to a faulty microphone. now i got this evo and for example when i text and i wanna hold for a question mark it just puts down the letter and wont let me hold and alot of other things are very unresponsive or move slowly. I actually got the notification bar to stay halfway down which never happen to me cause i think it automatically goes all the way down. I did install a invisible sheild but i dont think that has any effect since most of the water is gone.it was working fine before i installed it tho. i had to turn the device off when the bottom buttons wouldnt respond until i would put it to sleep and then shortly after it go back to not responding then the screen stopped responding. is this faulty hardware?

View 10 Replies View Related

Android :: Open A AlertDialog In SurfaceView?

Aug 5, 2009

I'm work a game, when game over, I want to open a AlertDialog in the Surfaceview.

How can I open a AlertDialog in SurfaceView??

View 2 Replies View Related

Android :: AlertDialog With Customized ListView

Sep 9, 2010

I am playing with the AlterDialog with a customized ListView in it.

After the ListView is added into the AlterDialog, there is a centered gradient separator line below the title of the alter dialog, it is just above the ListView.

Is there any way to get rid of it or change its color ? I do not want to show it.

View 2 Replies View Related

Android :: Long Key Press Handling In 1.5

Mar 23, 2010

I want to handle key press and long key press for the key code KEYCODE_CALL(dial button). can any one suggest me how this in android 1.5(API level 3).

View 2 Replies View Related

General :: Long Press Notifications

May 26, 2014

I've had my nexus 4 rooted for a couple months now and it's amazing but I'm having a problem when I long press notifications, nothing happens. Normally I have "app info" and "open in halo" but nothing pops up at all.

View 6 Replies View Related

Android : AlertDialog And Keyboard Open Configuration Change

May 6, 2010

My app creates and shows an AlertDialog which accepts input from the user (the user needs to type some text into an EditInput).

With the AlertDialog on screen, if the user opens up the keyboard on the device, then the app's OnCreate and OnResume methods are called and my AlertDialog promptly disappears from the screen ... not the effect I was hoping for!

I thought that perhaps I needed to override the Activity's onConfigurationChanged method, but despite having the following in my Manifest:

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

View 6 Replies View Related

Android :: Way To Get Long Press On Home Key Event?

Jul 29, 2010

Is there any way to get the long press on home key event?

View 3 Replies View Related

HTC Incredible :: Way To Add App To Search Button Long Press?

Jul 26, 2010

There are 2 programs already mapped to the "Search Button" on my phone. I want to add the "Edwin" app to that list.Does anyone know if that is possible?

View 4 Replies View Related

Android :: Detecting Long Press On Map Overlay

Aug 13, 2009

I want to be able to detect where a user has long pressed on my Map Overlay.The idea being to get the GeoPoint of the location the user pressed.I can detect where a user taps, but cannot find how to detect a long press.

View 5 Replies View Related

Android :: Send Long Press From An InstrumentationTestCase?

May 26, 2010

In Android, how can I send a long press from an InstrumentationTestCase? I'd like for instance to do a sendKeys(KEYCODE_DPAD_CENTER) but make that a long click.

View 1 Replies View Related

Android : How Long Is Press To Trigger Event

Dec 18, 2009

Android supports an event onLongPress. The question I have is 'how long' (in milliseconds) is the 'press' to trigger the event?

View 4 Replies View Related

General :: Long Press Home Button - What Does It Do

Jun 1, 2013

Is long pression the home button and removing open/recent apps "killing" the apps? I read that there is no need to "kill" an app and it actually uses more battery life than it saves. Should I be actively swiping away recent apps?

View 2 Replies View Related

Android :: How To Capture Long Press Of Menu Button?

Jul 27, 2010

How can I capture a long press of the device menu button in my application?I thought of an intent filter, but there's only an action called android.intent.action.SEARCH_LONG_PRESS, but nothing for the MENU button.I found that long press of the menu button actually does different things on different devices,i.e. on Nexus One it will show the soft keyboard, while on Samsung Galaxy S it will pop up the search widget.

View 5 Replies View Related

Android :: How To Start Activity With Long Press Of Search Key?

Nov 11, 2009

By default, if we long press search key it opens quick search box with the keypad slided up. what should be done if I want to change this default action to launching of an application when ever search key is long pressed. This obliviously requires changes in the framework. i tried changing some code in Search dialog.Java file but we can't use Start Activity there. pls guide.

View 2 Replies View Related

Motorola Droid :: Long Press + Skips Tracks?

May 4, 2010

While I was roaming around in the App section of the forum I stumbled across this thread. Long press "+" = skip track. One of the people who posted a comment in it claims that by long pressing on their volume rockers, will skip tracks. Does anyone here know if this is true? Apparently it only works with 2.1 and if this is the case, which I can't do cause I am running BB v1 but i am confused cause its in 2.1 even though I rooted under 2.0.1. Can anyone confirm this?

View 8 Replies View Related

Android :: Preventing Long Press To Save Images

Aug 13, 2010

I've written a web-app in HTML and Javascript for iPhone and Android which involves the dragging and dropping images.You initiate the drag by holding your finger over the image for about a second. However, Android then pops up the message giving me the option to save the image, set it as wallpaper etc.How can I prevent Android from doing this? Is there a metatag I can use? Some javascript?

View 2 Replies View Related

Sprint HTC Hero :: Long Press No Longer Working

Dec 7, 2009

I have noticed the long press no longer working.When I press and hold it will perform a short press. For example, when trying to long press on an icon to move it, it will open the application.I have noticed this only when charging the device. Anyone else have notice this strange behavior?

View 3 Replies View Related

Android :: App Still Runs During Long-press On Power And End Call Key / Why Is So - Can I Do This

Nov 24, 2009

Like as my HTC G2, when i long press the end call key, the phone option dialog shows and my app blurs. But the animation in the app still runs behind the dialog. I hope that the app stops or pauses when i long press the end call key. Can i do this?

View 2 Replies View Related

Android :: Detect Long Touch Press (action_down Only)?

Aug 30, 2010

I want to figure out how to detect that the user has been doing a long touch press on the screen? Most of the solutions that I see assume that the DOWN + UP sequence of events.

View 2 Replies View Related

Android : How To Set A Sound As Ringtone With Long Press On Button?

Sep 9, 2010

How do i set the sound as ringtone with long press on the button?

View 1 Replies View Related

General :: Unlock On Power Button Long Press?

Jun 11, 2012

I need to be able to skip the swipe screen and unlock the phone by long pressing the power button. On short press, it should act regularly (waking up and showing the swipe screen). I've tried "No Lock", "Autolock" and "My Lock Utility" but these unlock the phone immediately after pressing the power button I think this would be the ideal combination of functionality.

My phone is Motorola Atrix.

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

Motorola Droid X :: Way To Change Long Press Search Behaivor?

Nov 15, 2010

Is there any way to change the long press of the search button behavior on the Droid X? It seems like it's hard coded to bring up voice search. I want to use Rotation Toggle, which can toggle screen rotation on long press of search, but I can't with the Droid X. I am rooted so if the solution requires that, I'm good.

View 3 Replies View Related

Android :: Need App To Make Soft Keys Activated Only On Long Press

Oct 30, 2010

I was wondering. Is there an app for changing the soft keys on my Samsung Vibrant to only activate when pressed long or double clicked? I am just sick and tired of accidentally pressing them because they are so damn sensitive, and unlike the Fascinate or Epic 4g, so close to the touch screen that pressing spacebar on the onscreen keyboard half the time results in hitting the soft keys by accident. I don't understand why we can't customize what the soft keys do and how long or many times activates them, because if you got even normal sized finger tips, it's so annoying to be typing into the search bar and then press back right below and have to retype everything again.

View 1 Replies View Related

Android :: Need To Generate / Trigger Long Key Press Event Of Button

Aug 4, 2010

I need to generate/trigger a long key press event of a button in Android.Searched on net but not able to find any answers.

View 2 Replies View Related

General :: Long Press Application Icon Rotate The Screen

Nov 8, 2013

This only happens in landscape mode.

I've found a thread on it: [URL] .....

I've rebooted several times and tried both Nova Launcher and trebuchet.

View 2 Replies View Related

General :: How To Enable To Change Songs With Volume Long Press

Jan 23, 2014

I am new to android and i had owned a sony walkman mobile the feature which enabled me to change the songs with volume rocker long press...is missing on android...currently i own a sony xperia sp and running stock rom and stock firmware..how to root the mobile or mess around with the software..all i know is to download apks and install them...so developing apk which enables users to change songs with long press of volume rocker?..and as i mentioned above i do not have a rooted mobile so is there any way i can find or instal an apk to change songs with the volume rocker without rooting and custom roms?

View 2 Replies View Related

General :: Long Press Contacts In New Hangout Screen To Hide Them

Sep 28, 2013

New feature on the android Hangout app :

"Long press contacts in the New Hangout screen to hide them."

I tested and hided someone but now I wish to unhide him now, how can i do ?

I looked everywhere, can't find the option not even in block contacts, i can't see him with the green icon now even though he's online.

View 9 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

Sprint HTC Hero :: On Home Screen Long Press Menu Key Function?

Nov 15, 2009

I tried searching for this, to no avail, but here is the situation. I was on my main Home screen and just trying to figure stuff out and when I long press the menu key it brings up the onscreen keyboard. I figured it was for contact search or something, but it did nothing when I typed...or so I thought. Now everytime I back out to the Home screen a little transparent "window" displays with letters i first typed. I cant type new letters to display or even use the backspace key to erase. Any one know what Im talking about?

View 10 Replies View Related

Android :: Add Action On Browser's Context Menu After Link Long Press

Mar 14, 2010

I need to add an action in the Context Menu that pops up after a Long Press of a Link in the Browser (the one that has 'Open','Open in new window','Bookmark link','Save link', etc.)As a result of choosing my action it should call my service and etc.I don't want my app to overwrite all the context menu of the browser but only add an action to it.I haven't found any information on how to do this. Is it possible?

View 6 Replies View Related

Android :: How To Disable User Interaction Arising From Long Press To EditText?

Jan 19, 2010

A long press on an EditText brings up a menu of options that the user can select. The only messages or options that I want users of my apps to get, I want to come from me via the app. How do you disable this so that nothing happens when you long press the EditText? What other situations like this should I be aware of?

View 2 Replies View Related

HTC Droid Eris :: Home Screens Bottom Row Long Press Not Working?

Feb 25, 2010

So oddly enough my wife's Eris does not let her long press ANY of the bottom two rows of app icons/widgets. I can long press any of the top two rows apps/widgets fine to remove or add in an empty space. but the bottom two rows I can't remove or add with a long press.anyone else have this issue? I'm trying to figure out whats new but she isn't that into her phone so she never installs stuff on it, im the one tweaking and playing with her phone and I haven't touched it in a week this started happening randomly 2 days ago.

View 10 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

General :: Galaxy Note 2 Home Button Won't Work For Long Press?

Jan 14, 2013

i just got my note 2 and week ago and until yesterday when i hold down the home button to get to my tasks manager it wont work. Ill hold it down but it will vibrate but nothing comes up -_- im not sure if i turned something off or if its broken. anything i should try before i go to the verizon store or something?

View 5 Replies View Related

General :: How To Use Long Press Volume Keys To Change Songs In Wildfire

Jul 14, 2012

I tried the mod for other set models like galaxy s 2 but they put my phone into bootloops.

View 1 Replies View Related

General :: Rooted Xperia S - Change Menu Button Long Press App

Jul 30, 2012

I wanted to know is there a way to change which app launches when you long press the menu button? Currently it's Google search.

I'm on a rooted Xperia S, if that matters.

View 2 Replies View Related

General :: How To Disable Long Press Headset Button Activates Google Now

Oct 23, 2012

On ICS I used to skip songs on Poweramp using the headset button, but since I upgraded to Jellybean, the long press goes to Voice Search on Google Now? Is there a way to disable that? I already configured on Poweramp to use the long press, gave it high priority, but google voice continues taking place and there's no options there to disable it.

View 9 Replies View Related

General :: Long Press Headset Not Start Google Now When Screen Locked

Feb 20, 2013

Galaxy Nexus
Android Version: 4.2.2

Steps to reproduce the problem:

- plug in headset
- lock screen
- press headset button for several seconds

What happened:

- No reaction, Google Now / Voice Actions not launched
- Manually unlock screen
- Long press with unlocked screen correctly launches Voice Search

What you think the correct behaviour should be:

Long press of headset button should launch Google Now / Voice Actions even with locked screen. Having to dig the phone out of your pocket in order to launch Voice Actions with a headset e.g. to place a call kinda defeats the purpose of using Voice Actions in the first place.

Adding insult to injury: long press is not broadcast to other applications because of Google Now, so it can't even be put to good use e.g. as volume control.

This was open and ignored by code. [URL]... Issue 48616

View 9 Replies View Related

Samsung Moment :: Long Press Icons On Home Screen When Unlock Phone

Nov 18, 2010

It seems like almost every time that I unlock my phone, one of the icons on the home screen is selected (long press, like I was intending to move it or trash it). Using Launcher Pro, if that might be causing it. I don't think it was doing this before the last Sprint update, but don't know if that's the cause either.

View 2 Replies View Related

ADVERTISEMENT