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. implementing apps on the G1

I've been searching around the android developer sites, but have been
unable to find out how to put programs directly on an android phone.
Now that an android phone is out, (t-mobile's g1), how can developers
with access to a physical g1 put their applications on the phone?

--~--~---------~--~----~------------~-------~--~----~

2. TabHost and TabWidget

I'm having problems using TabHost and TabWidget, adding either of them
in my main.xml file gives a null pointer exception. Can someone post a
correct and current example of these? Thank you.
--~--~---------~--~----~------------~-------~--~----~

3. Git and proxy HOW TO?

4. repo sync always dies

5. question...

6. Simulate key press action?

7. first attempt - ERROR