Long Press ListView item to open AlertDialog

by Abhi » Fri, 11 Dec 2009 03:35:48 GMT


Sponsored Links
 Hi,

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

Abhishek

--



Long Press ListView item to open AlertDialog

by Jason Proctor » Fri, 11 Dec 2009 03:40:15 GMT


 yes.



>


Sponsored Links


Long Press ListView item to open AlertDialog

by Abhi » Fri, 11 Dec 2009 03:49:28 GMT


 would you be able to guide me to the right tutorial? I am unable to
find it

Thanks,

Abhi

On Dec 10, 2:39pm, Jason Proctor <jason.android.li...@gmail.com>


> >



Long Press ListView item to open AlertDialog

by Jason Proctor » Fri, 11 Dec 2009 03:54:24 GMT


 check Activity.registerForContextMenu()

and Activity.onCreateContextMenu()

works for me.


>>  >



Long Press ListView item to open AlertDialog

by Abhi » Fri, 11 Dec 2009 04:04:09 GMT


 Jason,

Thanks. But this is for opening a context menu on long press. I am
trying to open the alert dialog instead.

Abhishek

On Dec 10, 2:53pm, Jason Proctor <jason.android.li...@gmail.com>



> >> >



Long Press ListView item to open AlertDialog

by Jason Proctor » Fri, 11 Dec 2009 04:08:28 GMT


 oh sorry i misread your post.

have you played with overriding View.setLongClickable() and 
View.setOnLongClickListener() ?

opening a dialog when the latter goes off should work.





>>  >>  >



Other Threads

1. Sense of AnimationDrawable and of Animation classes at all

Hello,
I experimented with frame animations to use them in a game. It seems
that it's obviously the easiest way to load all Bitmaps in an array of
Bitmaps and to draw every thread tick the next frame to the canvas.

Before I tried out making animations with AnimationDrawable. First of
all it is to draw to the background of an (Image)View. Then the
background is to read into an AnimationDrawable which is usable. But
what can I do with that because as I tried to use animation classes
like AnimationDrawable I was not even able to draw the animation to a
specific position because it's a view with one background which sticks
anywhere on the screen and it is to draw with animation.draw(canvas)
instead of canvas.drawBitmap(Bitmap, 20, 20, null) (You don't even
have Bitmaps in your animation. That's the next difficulty). I'm not
even able to change the "speed" or the duration of the animation,
because I have to define the duration in the XML file once. It's very
unwiedly to make a simple animation with this approach. Maybe I don't
know how to use this in a meaningful way.
Hence I'd like to know what this approach with AnimationDrawable is
good for? Do I understand that right that this is not intended as
usage in games? Up to now I see no benefit in using these Animation
classes.

Regards.


-- 

2. how to get device's movement speed?

Hi!

Imagine to have the device perpediculare to the table, in portrait.
The Z axis is watching to you and the Y axis to the sky.
I want to misure the device's movement speed when I rotate it on the X
axis.

How can i get it?

-- 

3. Android 2.1 for the ADP2... here it is!

4. Service vs Singleton

5. remembering login/pass

6. Android OpenGL Game - App Architecture and Threading Logic

7. 'Squeezing' a button on the right side