Dialog doesn't show in a ListActivity

by Daniel Rindt » Mon, 14 Mar 2011 16:38:08 GMT


Sponsored Links
 Dear reader,

my code is pasted here  http://rifers.org/paste/show/1254. 
The problem is that the dialog showContextDialog() is not displayed. The
dialog code is directly used from android examples. I played a lot
around put that code directly in onResume and so on - no efforts.

I'm thankful for all hints to solve that problem.

Thanks for reading
Daniel


-- 



Re: Dialog doesn't show in a ListActivity

by TreKing » Mon, 14 Mar 2011 20:45:04 GMT


 On Mon, Mar 14, 2011 at 3:37 AM, Daniel Rindt




Well, a dialog is not going to be displayed if you don't tell the system to
display it, which is done with the show() method.



Can you post the examples you got that from? Because that's wrong in so many
ways.



1 - Never use getApplicationContext() - it's utterly pointless and just does
not work with dialogs.
2 - Call show() on the Dialog you create to actually show it.

-------------------------------------------------------------------------------------------------
TreKing < http://sites.google.com/site/rezmobileapps/treking> ; - Chicago
transit tracking app for Android-powered devices

-- 


Sponsored Links


Re: Dialog doesn't show in a ListActivity

by Daniel Rindt » Mon, 14 Mar 2011 21:45:40 GMT


 Am Montag, den 14.03.2011, 07:44 -0500 schrieb TreKing:
 http://developer.android.com/guide/topics/ui/dialogs.html #AlertDialog
Its the Paragraph "Adding a list".

How then obtain the Context to display it?

In the docs i found:
AlertDialog.Builder.create();
also shows the Dialog.

Thanks
Daniel

-- 



Re: Dialog doesn't show in a ListActivity

by Mark Murphy » Mon, 14 Mar 2011 21:47:37 GMT


 On Mon, Mar 14, 2011 at 9:43 AM, Daniel Rindt



Your activity *is* a Context.

-- 
Mark Murphy (a Commons Guy)
 http://commonsware.com  |  http://github.com/commonsguy 
 http://commonsware.com/blog  |  http://twitter.com/commonsguy 

Android Training in Oslo:  http://bit.ly/fjBo24 

-- 



Re: Dialog doesn't show in a ListActivity

by TreKing » Mon, 14 Mar 2011 21:55:32 GMT


 On Mon, Mar 14, 2011 at 8:43 AM, Daniel Rindt





Where? In the docs I found:
 http://developer.android.com/reference/android/app/AlertDialog.Builder.html #create()
< http://developer.android.com/reference/android/app/AlertDialog.Builder.html #create()>
< http://developer.android.com/reference/android/app/AlertDialog.Builder.html #create()>


-------------------------------------------------------------------------------------------------
TreKing < http://sites.google.com/site/rezmobileapps/treking> ; - Chicago
transit tracking app for Android-powered devices

-- 



Re: Dialog doesn't show in a ListActivity

by Daniel Rindt » Mon, 14 Mar 2011 22:18:17 GMT


 Am Montag, den 14.03.2011, 08:53 -0500 schrieb TreKing:
Yes thanks for open up my eyes. :)

Daniel

-- 



Other Threads

1. Can we hide Activity

Hai,

Is it possible to hide a Activity in Android?

My requirement is, i am starting a service during booting up of
Android.
But when the service is staring the main UI is also coming up.
I would like to hide this UI window.

Is there any way?
Please help...

Thanks in advance.

Rahul
--~--~---------~--~----~------------~-------~--~----~

2. Show Home Screen

hi,

Is it possible to show home screen of android using some API or
Manifest file

Thank You.
--~--~---------~--~----~------------~-------~--~----~

3. Threading memory leak

4. memory problems

5. java.lang.StackOverflowError when deserializing

6. Of Progress Bars and Wait Dialogs

7. MyFavs application sending/receiving SMS