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. implicit intents

hallo i have made two applications A and B.A binds to a service of B
using an implicit intent:

intent i =new Intent ("level1.level2");

Application B has a service that has an intent filter for actions of
type "level1.level2".

The problem is that B is not always called.Sometimes it is called anad
everything works fine but some other times i get the following warning
in DDMS :

unable to start service Intent { act=level1.level2 } :not found

why is that??

-- 

2. Android Anti-Pirac

Android Application Anti-Piracy Movement
http://www.artfulbits.com/Android/antipiracy.aspx

Petition to Google: "Google should stop Android Market piracy threat"
http://www.petitionspot.com/petitions/androidpiracy

Forum where can be discussed anti-piracy strategies:
http://www.artfulbits.com/Support

Start of anti-piracy discussion is here:

3. Aplikasi bantu untuk stop rokok

4. use a button to move a cursor in a widget

5. Screen Orientation in Android

6. CSS support on WebView

7. Tampilan 3d home untuk android