On Wed, Jun 23, 2010 at 4:38 AM, Nishant Kumar <[email protected]>wrote:

> I am trying to display a dialog box in a simple Java class that is called
> from my main Activity but not successful.
>

First question: why are you trying to show a dialog from a class that is not
an Activity?


> But I am *unable to call* the onCreateDialog method that I have *defined
> in the simple java class*.
>
> However , If I define the *onCreateDialog method in MainActivity*, I am
> able to display it* successfully.
> *
>

Well onCreateDialog is defined in Activity. How do you expect it to be
called in your custom class that does not extend Activity and thus does not
inherit the function?

WHAT ARE YOU TRYING TO ACCOMPLISH?

On Wed, Jun 23, 2010 at 8:52 AM, Gyan <[email protected]> wrote:

> make the activity variable static


No.

and don't use this try getApplicationContext


Hells no.


> or an instance created with new keyword


Now you're just f***ing with the us.

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

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to