1

I'm working on a view at Android 3.0, and in that specific scenario I don't have an access to the activity.

I need to display a dialog on the screen but I cannot use showDialog() since I don't have access to the Activity methods. But I do have access to the context which might help.

Does anybody has an idea how to display a dialog without using the showDialog() method? I need it also to be shown at a specific (x,y) point.

Yaniv
  • 3,321
  • 8
  • 30
  • 45

1 Answers1

1

How about creating an AlertDialog passing that context in?

It shows you a standard modal message box ...

http://developer.android.com/reference/android/app/AlertDialog.Builder.html

musaul
  • 2,341
  • 19
  • 26
  • Ah, didn't notice the bit about specific co-ordinates. Perhaps you could use `Toast` in that case ... http://developer.android.com/guide/topics/ui/notifiers/toasts.html – musaul May 16 '11 at 14:29
  • Toast isn't good enough, I need options also to be displayed in the dialog. – Yaniv May 16 '11 at 14:36
  • http://stackoverflow.com/questions/5469005/show-alertdialog-in-any-position-of-the-screen should be able to address the coordinate requirement, in which case this answer is correct AFAICS. – nmr Feb 16 '12 at 20:12