Bug: switch display (numlock 7) while dialog

Put your problem here if it does not fit any of the other categories.

Bug: switch display (numlock 7) while dialog

Postby darolla » Tue Dec 30, 2008 4:06 pm

hi,

i've found a bug.

1) open a dialog
2) switch the display (using numlock 7) portrait <-> landscape
3) android dialog dies

12-30 15:04:19.383: ERROR/WindowManager(7037): Activity netzprofis.android.sportbet.LoginActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@4343f580 that was originally added here
12-30 15:04:19.383: ERROR/WindowManager(7037): android.view.WindowLeaked: Activity netzprofis.android.sportbet.LoginActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@4343f580 that was originally added here
12-30 15:04:19.383: ERROR/WindowManager(7037): at android.view.ViewRoot.<init>(ViewRoot.java:178)
12-30 15:04:19.383: ERROR/WindowManager(7037): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:147)
12-30 15:04:19.383: ERROR/WindowManager(7037): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:90)
12-30 15:04:19.383: ERROR/WindowManager(7037): at android.view.Window$LocalWindowManager.addView(Window.java:393)
12-30 15:04:19.383: ERROR/WindowManager(7037): at android.app.Dialog.show(Dialog.java:212)
12-30 15:04:19.383: ERROR/WindowManager(7037): at netzprofis.android.sportbet.LoginActivity$LoginListener.onClick(LoginActivity.java:106)
12-30 15:04:19.383: ERROR/WindowManager(7037): at android.view.View.performClick(View.java:2109)
12-30 15:04:19.383: ERROR/WindowManager(7037): at android.view.View.onTouchEvent(View.java:3523)
12-30 15:04:19.383: ERROR/WindowManager(7037): at android.widget.TextView.onTouchEvent(TextView.java:4410)
12-30 15:04:19.383: ERROR/WindowManager(7037): at android.view.View.dispatchTouchEvent(View.java:3178)
12-30 15:04:19.383: ERROR/WindowManager(7037): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:857)
12-30 15:04:19.383: ERROR/WindowManager(7037): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:857)
12-30 15:04:19.383: ERROR/WindowManager(7037): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:857)
12-30 15:04:19.383: ERROR/WindowManager(7037): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:857)
12-30 15:04:19.383: ERROR/WindowManager(7037): at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1561)
12-30 15:04:19.383: ERROR/WindowManager(7037): at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1085)
12-30 15:04:19.383: ERROR/WindowManager(7037): at android.app.Activity.dispatchTouchEvent(Activity.java:1873)
12-30 15:04:19.383: ERROR/WindowManager(7037): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1545)
12-30 15:04:19.383: ERROR/WindowManager(7037): at android.view.ViewRoot.handleMessage(ViewRoot.java:1140)
12-30 15:04:19.383: ERROR/WindowManager(7037): at android.os.Handler.dispatchMessage(Handler.java:88)
12-30 15:04:19.383: ERROR/WindowManager(7037): at android.os.Looper.loop(Looper.java:123)
12-30 15:04:19.383: ERROR/WindowManager(7037): at android.app.ActivityThread.main(ActivityThread.java:3742)
12-30 15:04:19.383: ERROR/WindowManager(7037): at java.lang.reflect.Method.invokeNative(Native Method)
12-30 15:04:19.383: ERROR/WindowManager(7037): at java.lang.reflect.Method.invoke(Method.java:515)
12-30 15:04:19.383: ERROR/WindowManager(7037): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:739)
12-30 15:04:19.383: ERROR/WindowManager(7037): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:497)
12-30 15:04:19.383: ERROR/WindowManager(7037): at dalvik.system.NativeStart.main(Native Method)
12-30 15:04:19.784: DEBUG/dalvikvm(7037): GC freed 3166 objects / 196440 bytes in 120ms
12-30 15:04:21.393: INFO/ActivityManager(53): Starting activity: Intent { comp={netzprofis.android.sportbet/netzprofis.android.sportbet.HauptmenuListActivity} }
12-30 15:04:21.544: DEBUG/AndroidRuntime(7037): Shutting down VM
12-30 15:04:21.553: WARN/dalvikvm(7037): threadid=3: thread exiting with uncaught exception (group=0x40010e28)
12-30 15:04:21.563: ERROR/AndroidRuntime(7037): Uncaught handler: thread main exiting due to uncaught exception
12-30 15:04:21.593: ERROR/AndroidRuntime(7037): java.lang.IllegalArgumentException: View not attached to window manager
12-30 15:04:21.593: ERROR/AndroidRuntime(7037): at android.view.WindowManagerImpl.findViewLocked(WindowManagerImpl.java:331)
12-30 15:04:21.593: ERROR/AndroidRuntime(7037): at android.view.WindowManagerImpl.removeView(WindowManagerImpl.java:200)
12-30 15:04:21.593: ERROR/AndroidRuntime(7037): at android.view.Window$LocalWindowManager.removeView(Window.java:401)
12-30 15:04:21.593: ERROR/AndroidRuntime(7037): at android.app.Dialog.dismissDialog(Dialog.java:249)
12-30 15:04:21.593: ERROR/AndroidRuntime(7037): at android.app.Dialog.access$000(Dialog.java:59)
12-30 15:04:21.593: ERROR/AndroidRuntime(7037): at android.app.Dialog$1.run(Dialog.java:93)
12-30 15:04:21.593: ERROR/AndroidRuntime(7037): at android.os.Handler.handleCallback(Handler.java:542)
12-30 15:04:21.593: ERROR/AndroidRuntime(7037): at android.os.Handler.dispatchMessage(Handler.java:86)
12-30 15:04:21.593: ERROR/AndroidRuntime(7037): at android.os.Looper.loop(Looper.java:123)
12-30 15:04:21.593: ERROR/AndroidRuntime(7037): at android.app.ActivityThread.main(ActivityThread.java:3742)
12-30 15:04:21.593: ERROR/AndroidRuntime(7037): at java.lang.reflect.Method.invokeNative(Native Method)
12-30 15:04:21.593: ERROR/AndroidRuntime(7037): at java.lang.reflect.Method.invoke(Method.java:515)
12-30 15:04:21.593: ERROR/AndroidRuntime(7037): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:739)
12-30 15:04:21.593: ERROR/AndroidRuntime(7037): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:497)
12-30 15:04:21.593: ERROR/AndroidRuntime(7037): at dalvik.system.NativeStart.main(Native Method)
12-30 15:04:21.634: INFO/Process(53): Sending signal. PID: 7037 SIG: 3
12-30 15:04:21.654: INFO/dalvikvm(7037): threadid=7: reacting to signal 3
12-30 15:04:21.744: INFO/dalvikvm(7037): Wrote stack trace to '/data/anr/traces.txt'
12-30 15:04:22.234: DEBUG/dalvikvm(53): GC freed 668 objects / 34392 bytes in 118ms
12-30 15:04:31.443: WARN/ActivityManager(53): Launch timeout has expired, giving up wake lock!
12-30 15:04:31.495: WARN/ActivityManager(53): Activity idle timeout for HistoryRecord{4338c3f8 {netzprofis.android.sportbet/netzprofis.android.sportbet.HauptmenuListActivity}}
User avatar
darolla
Master Developer
Master Developer
 
Posts: 273
Joined: Thu Sep 25, 2008 5:16 pm
Location: Dortmund, Germany

Top

Postby darolla » Tue Dec 30, 2008 4:10 pm

the dialog that causes the exception while switching display is a progress dialog which waits for 3 sec.

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2. protected class LoginListener implements OnClickListener {
  3.  
  4.         public void onClick(View v) {
  5.  
  6.                 ProgressDialog progress = new ProgressDialog(LoginActivity.this);
  7.  
  8.                 progress.setIcon(R.drawable.blind);
  9.  
  10.                 progress.setTitle("Bitte warten");
  11.  
  12.                 progress.setMessage("Verbindung wird aufgebaut.");
  13.  
  14.                 progress.show();
  15.  
  16.                 WaitingThread wt = new WaitingThread(progress);
  17.  
  18.                 wt.start();
  19.  
  20.         }
  21.  
  22. }
  23.  
  24.  
  25.  
  26. protected class WaitingThread extends Thread {
  27.  
  28.  
  29.  
  30.         private ProgressDialog progress;
  31.  
  32.  
  33.  
  34.         public WaitingThread(ProgressDialog progress) {
  35.  
  36.                 super();
  37.  
  38.                 this.progress = progress;
  39.  
  40.         }
  41.  
  42.  
  43.  
  44.         @Override
  45.  
  46.         public void run() {
  47.  
  48.                 try {
  49.  
  50.                         sleep(3000);
  51.  
  52.                 } catch (Exception e) {
  53.  
  54.                 }
  55.  
  56.                 Intent intent = new Intent();
  57.  
  58.                 intent.setClass(LoginActivity.this, HauptmenuListActivity.class);
  59.  
  60.                 startActivity(intent);
  61.  
  62.  
  63.  
  64.                 progress.dismiss();
  65.  
  66.         }
  67.  
  68. }
  69.  
  70.  
Parsed in 0.034 seconds, using GeSHi 1.0.8.4
User avatar
darolla
Master Developer
Master Developer
 
Posts: 273
Joined: Thu Sep 25, 2008 5:16 pm
Location: Dortmund, Germany

Postby darolla » Tue Dec 30, 2008 4:12 pm

but the same error occurs using any other dialog technique:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2. Builder builder = new AlertDialog.Builder(this);
  3.  
  4. builder.setTitle("Hilfe");
  5.  
  6. builder.setMessage("bla bla...");
  7.  
  8. builder.setPositiveButton("OK", null);
  9.  
  10. builder.show();
  11.  
  12.  
Parsed in 0.032 seconds, using GeSHi 1.0.8.4
User avatar
darolla
Master Developer
Master Developer
 
Posts: 273
Joined: Thu Sep 25, 2008 5:16 pm
Location: Dortmund, Germany

Postby artnun » Tue Dec 30, 2008 10:01 pm

I think we have the same problem, I had posted a thread here but still no answer.
artnun
Junior Developer
Junior Developer
 
Posts: 11
Joined: Mon Nov 03, 2008 8:50 pm

Postby Emmanuel7 » Wed Dec 31, 2008 2:42 am

darolla wrote:but the same error occurs using any other dialog technique:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. Builder builder = new AlertDialog.Builder(this);
  2. builder.setTitle("Hilfe");
  3. builder.setMessage("bla bla...");
  4. builder.setPositiveButton("OK", null);
  5. builder.show();
  6.  
Parsed in 0.034 seconds, using GeSHi 1.0.8.4


it's strange, I have a alert dialog constructed just like that (but with an editView instead of the message ), and I have no problem.
I haven't updated to the RC2 SDK yet, could it be a bug in the new SDK ?
Emmanuel7
Senior Developer
Senior Developer
 
Posts: 164
Joined: Fri Dec 12, 2008 2:17 am
Location: Paris

Postby sikus » Tue Apr 14, 2009 10:44 am

Hello All,
i have the same problem. Solve anybody this problem?
sikus
Junior Developer
Junior Developer
 
Posts: 12
Joined: Mon Dec 15, 2008 3:48 pm

Top

Postby WarrenFaith » Tue Apr 14, 2009 10:49 am

Sure it is a bug?
java.lang.IllegalArgumentException: View not attached to window manager

Add the Dialog to the WindowManager and the problem should be solved... try it
WarrenFaith
Moderator
Moderator
 
Posts: 227
Joined: Fri Mar 13, 2009 10:59 am
Location: Berlin, Germany

Postby sikus » Tue Apr 14, 2009 12:52 pm

WarrenFaith wrote:Add the Dialog to the WindowManager and the problem should be solved... try it

Thanks, but I have no idea how can I try it... Could you give snippet code here, please?
sikus
Junior Developer
Junior Developer
 
Posts: 12
Joined: Mon Dec 15, 2008 3:48 pm

Postby sikus » Tue May 19, 2009 3:58 pm

So, I try add <activity android:name=".Name" android:configChanges="keyboardHidden|orientation"> to the manifest and everything works good. Error don't occur.
sikus
Junior Developer
Junior Developer
 
Posts: 12
Joined: Mon Dec 15, 2008 3:48 pm

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: Google Feedfetcher and 19 guests