[android-developers] Re: Activity finish() question ??

2009-04-28 Thread Neo
because if i create media used the Application point(), i can't hear the sound public void playAudio(int type) { mMediaPlayer = MediaPlayer.create(this(or getBaseContext()), R.raw.online); mMediaPlayer.start(); }

[android-developers] Re: Activity finish() question ??

2009-04-27 Thread Neo
public static MyApplication getApplication(Activity activity) { // TODO should this be synchronized? if (app == null) { initialize(activity); } mActivity = activity; return app; } I means if i finish the Activity B, The

[android-developers] Re: Activity finish() question ??

2009-04-27 Thread Dianne Hackborn
You aren't supplying enough code to understand what you are doing (who is calling getApplication()?). But I'll see again -- if you don't see the pointer to null, then yes, you will never get a null back. On Sun, Apr 26, 2009 at 11:32 PM, Neo mobi.liub...@gmail.com wrote: public static

[android-developers] Re: Activity finish() question ??

2009-04-27 Thread Neo
Application class public class MyApplication extends Application{ public static MyApplication getApplication(Activity activity) { // TODO should this be synchronized? if (app == null) { initialize(activity); } mActivity = activity;

[android-developers] Re: Activity finish() question ??

2009-04-26 Thread Dianne Hackborn
If you are explicitly setting it, you will need to explicitly clear it at some point, possibly in onDestroy(). Note that you need to be very careful when doing this kind of thing. Generally the most safe global to store like this is the currently resumed activity, set in onResume() and cleared in