Hi!

I am trying to create an always on top, clickable button, like the one from
this app:
http://www.appbrain.com/app/smart-taskbar-%28sidebar%29/com.smart.taskbar
In order to do this, I have ported in c# this code:
http://stackoverflow.com/questions/4481226/creating-a-system-overlay-always-on-top-button-in-android
But it throws an exception of type WindowManagerBadTokenException from the
line where I add the custom view and parameters to the window manager (the
.AddView line)
Using a breakpoint, i saw that parameter's Token property is null.
Here
http://developer.android.com/reference/android/view/WindowManager.LayoutParams.html#tokenit
says that 'This will usually be filled in for you'.

Here's my code:
mView=new ButtonView (Application.Context);
IWindowManager iwm=this.GetSystemService (Context.WindowService).JavaCast
<IWindowManager> ();;
WindowManagerLayoutParams param=new WindowManagerLayoutParams
(WindowManagerTypes.SystemOverlay, WindowManagerFlags.WatchOutsideTouch,
Format.Translucent);
param.Gravity=GravityFlags.Right | GravityFlags.Top;
param.Title="Load Average";
iwm.AddView (mView, param);

Is there a solution?
Thanks in advance.
_______________________________________________
Monodroid mailing list
Monodroid@lists.ximian.com

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

Reply via email to