Custom component using custom dialog

by Nigel » Wed, 09 Sep 2009 02:15:28 GMT

Sponsored Links
 My application needs to be aware of a custom dialog, which is used
only by a custom component.  By "aware" I mean through the
onCreateDialog and onPrepareDialog.

I would like the dialog to be fully encapsulated by the component, but
if the component performs a:

Dialog d = new CustomDialog(getContext());;

rather than:

Activity a = (Activity)getContext();

I get an exception - primarily because the dialog's "onCreate(Bundle
b)" method doesn't get automatically called.

I'm looking for opinions on the best way to structure the code...

Comments welcomed.




Custom component using custom dialog

by Nigel » Thu, 10 Sep 2009 13:35:33 GMT

 In the end I have performed this with the client code making an
explicit call to perform the required initialisation.  This doesn't
feel right, but it works.


Sponsored Links

Other Threads

1. alsa-lib

today i get the master code. when I  compile ALSA, and it says
external/alsa-lib/src/shmarea.c:27:21: error: sys/shm.h: No such file or
what should I do now? now i copy the shm.h from the former version android.
can be ok?


2. Android 1.1_r1 SDK released and launched

Hey developers, today we released the new, 1.1_r1 SDK. This SDK
includes some minor updates that you can read more about on the blog,
. Also, we've launched the new developer site at
which has updated documentation for the 1.1_r1 SDK.

Android Team @ Google

3. download application on google Market

4. Hey Guys =]

5. Adding text to a custom drawable

6. Bluetooth : RFCOMM connection fails while connecting to a headset which is in discoverable mode.

7. Static Variables after Application life cycle