Quantcast

Window.DecorView.Visibility and TabActivity

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Window.DecorView.Visibility and TabActivity

Christian

Hi there,

 

has anyone ever tried to hide the android 4 bar with that three-dot-button (e.g. HTC ONE S)?

From what I read and what mono offers, I tried this:

 

Window.DecorView.Visibility = ViewStates.Invisible;

 

It seems to work for some activities but not for all. Whenever I start an activity that is a TabActivity, I get a Java.Lang.Exception and the screen stays black.

 

As I don’t necessarily need to hide that button when the TabActivity is shown, I tried to only enable this option for the other activities but the same error still occurs.

 

Summed up:

Activity A (main, launcher) hides the bar  in OnResume and shows it in OnPause. Works as expected.

Acitivty B (TabActivity) is launched by an intent resulting from an action performed in A. Whenever A hid the bar, B stays black and an exception is thrown.

 

Any ideas?

 

Regards

Christian

 

 


_______________________________________________
Monodroid mailing list
[hidden email]

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Window.DecorView.Visibility and TabActivity

Jonathan Pryor-2
On Jul 26, 2012, at 7:12 AM, "Breyer, Christian" <[hidden email]> wrote:
> Acitivty B (TabActivity) is launched by an intent resulting from an action performed in A. Whenever A hid the bar, B stays black and an exception is thrown.

Please provide the full stack trace as obtained from the Android Debug Log:

        http://docs.xamarin.com/android/advanced_topics/android_debug_log

 - Jon

_______________________________________________
Monodroid mailing list
[hidden email]

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Window.DecorView.Visibility and TabActivity

Christian
In reply to this post by Christian
Thank you Jon for your answer.
This might be the trace you are looking for:

07-27 13:00:12.835: W/dalvikvm(25355): threadid=1: thread exiting with uncaught exception (group=0x40c511f8)
07-27 13:00:12.835: E/WindowManager(1854): Window Session Crash
07-27 13:00:12.835: E/WindowManager(1854): java.lang.IllegalArgumentException: Window type can not be changed after the window is added.
07-27 13:00:12.835: E/WindowManager(1854): at com.android.server.wm.WindowManagerService.relayoutWindow(WindowManagerService.java:2904)
07-27 13:00:12.835: E/WindowManager(1854): at com.android.server.wm.Session.relayout(Session.java:158)
07-27 13:00:12.835: E/WindowManager(1854): at android.view.IWindowSession$Stub.onTransact(IWindowSession.java:160)
07-27 13:00:12.835: E/WindowManager(1854): at com.android.server.wm.Session.onTransact(Session.java:111)
07-27 13:00:12.835: E/WindowManager(1854): at android.os.Binder.execTransact(Binder.java:338)
07-27 13:00:12.835: E/WindowManager(1854): at dalvik.system.NativeStart.run(Native Method)

I don't understand the error message since I do not make any changes to the TabActivity or to one of the activities added to it.
This really only occurs if the previous activity has its DecorView set to invisible.

Regards
Christian

-----Ursprüngliche Nachricht-----
Von: [hidden email] [mailto:[hidden email]] Im Auftrag von Jonathan Pryor
Gesendet: Freitag, 27. Juli 2012 05:18
An: Discussions related to Mono for Android
Betreff: Re: [mono-android] Window.DecorView.Visibility and TabActivity

On Jul 26, 2012, at 7:12 AM, "Breyer, Christian" <[hidden email]> wrote:
> Acitivty B (TabActivity) is launched by an intent resulting from an action performed in A. Whenever A hid the bar, B stays black and an exception is thrown.

Please provide the full stack trace as obtained from the Android Debug Log:

        http://docs.xamarin.com/android/advanced_topics/android_debug_log

 - Jon

_______________________________________________
Monodroid mailing list
[hidden email]

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid



_______________________________________________
Monodroid mailing list
[hidden email]

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Window.DecorView.Visibility and TabActivity

Christian
In reply to this post by Christian
It turns out, I was wrong blaming the DecorView for the error.

It is not the DecorView visibility settings that is causing the crash of the TabActivity but the API Level from the Manifest.
When I choose android 2.3 (level 10) it works, when I choose 4.0 the error below occurs.

I just did not realize it because whenever I was testing the DecorView settings, I switched the API level, as this function is not available in 2.3.


Regards
Christian


-----Ursprüngliche Nachricht-----
Von: [hidden email] [mailto:[hidden email]] Im Auftrag von Breyer, Christian
Gesendet: Freitag, 27. Juli 2012 13:17
An: [hidden email]
Betreff: Re: [mono-android] Window.DecorView.Visibility and TabActivity

Thank you Jon for your answer.
This might be the trace you are looking for:

07-27 13:00:12.835: W/dalvikvm(25355): threadid=1: thread exiting with uncaught exception (group=0x40c511f8)
07-27 13:00:12.835: E/WindowManager(1854): Window Session Crash
07-27 13:00:12.835: E/WindowManager(1854): java.lang.IllegalArgumentException: Window type can not be changed after the window is added.
07-27 13:00:12.835: E/WindowManager(1854): at com.android.server.wm.WindowManagerService.relayoutWindow(WindowManagerService.java:2904)
07-27 13:00:12.835: E/WindowManager(1854): at com.android.server.wm.Session.relayout(Session.java:158)
07-27 13:00:12.835: E/WindowManager(1854): at android.view.IWindowSession$Stub.onTransact(IWindowSession.java:160)
07-27 13:00:12.835: E/WindowManager(1854): at com.android.server.wm.Session.onTransact(Session.java:111)
07-27 13:00:12.835: E/WindowManager(1854): at android.os.Binder.execTransact(Binder.java:338)
07-27 13:00:12.835: E/WindowManager(1854): at dalvik.system.NativeStart.run(Native Method)

I don't understand the error message since I do not make any changes to the TabActivity or to one of the activities added to it.
This really only occurs if the previous activity has its DecorView set to invisible.

Regards
Christian

-----Ursprüngliche Nachricht-----
Von: [hidden email] [mailto:[hidden email]] Im Auftrag von Jonathan Pryor
Gesendet: Freitag, 27. Juli 2012 05:18
An: Discussions related to Mono for Android
Betreff: Re: [mono-android] Window.DecorView.Visibility and TabActivity

On Jul 26, 2012, at 7:12 AM, "Breyer, Christian" <[hidden email]> wrote:
> Acitivty B (TabActivity) is launched by an intent resulting from an action performed in A. Whenever A hid the bar, B stays black and an exception is thrown.

Please provide the full stack trace as obtained from the Android Debug Log:

        http://docs.xamarin.com/android/advanced_topics/android_debug_log

 - Jon

_______________________________________________
Monodroid mailing list
[hidden email]

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid



_______________________________________________
Monodroid mailing list
[hidden email]

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid



_______________________________________________
Monodroid mailing list
[hidden email]

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid
Loading...