Crash Launcher2 NullPointerException in onDetachedFromWindow()

Hi,

I'm developping an application on Nexus S that testing some Android API.
To do so, I need to pause/resume my application :

// Cause activity to be brought to front
void resumeActivity()
{
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.setClassName(MyActivity.class.getPackage().getName(), 
MyActivity.class.getName());
intent.addFlags(Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT);
m_activity.startActivity(intent);
}

// Cause home screen to come foreground.
void hideActivity()
{
Intent i = new Intent();
i.setAction(Intent.ACTION_MAIN);
i.addCategory(Intent.CATEGORY_HOME);
m_activity.startActivity(i);
m_activity).waitOnPause(); // This function use a wait() and onResume call 
notify().
}

It's working with Android 2.3.3 (custom build)

And I get the crash on Android 2.3.3 official build (I9020XXXJK1, 
2.6.35.7-g1d030a7 GRI40)
and on Android 2.3.5 r1 (custom build)


E/AndroidRuntime( 5709): java.lang.NullPointerException
E/AndroidRuntime( 5709): at 
com.android.launcher2.AllApps3D.onDetachedFromWindow(AllApps3D.java:210)
E/AndroidRuntime( 5709): at 
android.view.View.dispatchDetachedFromWindow(View.java:6173)
E/AndroidRuntime( 5709): at 
android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:1162)
E/AndroidRuntime( 5709): at 
android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:1162)
E/AndroidRuntime( 5709): at 
android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:1162)
E/AndroidRuntime( 5709): at 
android.view.ViewRoot.dispatchDetachedFromWindow(ViewRoot.java:1746)
E/AndroidRuntime( 5709): at android.view.ViewRoot.doDie(ViewRoot.java:2757)
E/AndroidRuntime( 5709): at android.view.ViewRoot.die(ViewRoot.java:2727)
E/AndroidRuntime( 5709): at 
android.view.WindowManagerImpl.removeViewImmediate(WindowManagerImpl.java:218)
E/AndroidRuntime( 5709): at 
android.view.Window$LocalWindowManager.removeViewImmediate(Window.java:436)
E/AndroidRuntime( 5709): at 
android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:2701)
E/AndroidRuntime( 5709): at 
android.app.ActivityThread.access$2100(ActivityThread.java:117)
E/AndroidRuntime( 5709): at 
android.app.ActivityThread$H.handleMessage(ActivityThread.java:964)
E/AndroidRuntime( 5709): at 
android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 5709): at android.os.Looper.loop(Looper.java:130)
E/AndroidRuntime( 5709): at 
android.app.ActivityThread.main(ActivityThread.java:3683)
E/AndroidRuntime( 5709): at java.lang.reflect.Method.invokeNative(Native 
Method)
E/AndroidRuntime( 5709): at java.lang.reflect.Method.invoke(Method.java:507)
E/AndroidRuntime( 5709): at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
E/AndroidRuntime( 5709): at 
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
E/AndroidRuntime( 5709): at dalvik.system.NativeStart.main(Native Method)

Hope it's help :)

Do I need to open a bug at http://code.google.com/p/android/issues/list ?

Regards.

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

Reply via email to