Re: [mono-android] IWindowManager

2011-09-27 Thread Jonathan Pobst
Or if you have an Activity or View, you can just access the WindowManager property. Jonathan On 9/27/2011 10:27 AM, Jonathan Pryor wrote: > On Sep 27, 2011, at 10:12 AM, tsukrov wrote: >> mWindowManager = >> (IWindowManager)context.GetSystemService(Context.WindowService); > > Sadly, this is a "

Re: [mono-android] IWindowManager

2011-09-27 Thread tsukrov
A lot of thanks. -- View this message in context: http://mono-for-android.1047100.n5.nabble.com/IWindowManager-tp4845524p4845795.html Sent from the Mono for Android mailing list archive at Nabble.com. ___ Monodroid mailing list Monodroid@lists.ximian.co

Re: [mono-android] IWindowManager

2011-09-27 Thread Jonathan Pryor
On Sep 27, 2011, at 10:12 AM, tsukrov wrote: > mWindowManager = > (IWindowManager)context.GetSystemService(Context.WindowService); Sadly, this is a "leaky abstraction" -- Context.GetSystemService() returns a Java.Lang.Object(), so our generator has no idea what type it could be. Furthermore, th

Re: [mono-android] IWindowManager

2011-09-27 Thread tsukrov
Sure, you are right, but the question was: the resulting object HAS to be IWindowManager, hasn't it? -- View this message in context: http://mono-for-android.1047100.n5.nabble.com/IWindowManager-tp4845524p4845645.html Sent from the Mono for Android mailing list archive at Nabble.com. ___

Re: [mono-android] IWindowManager

2011-09-27 Thread efontana
I think you want: mWindowManager = context.GetSystemService(Context.WindowService) as IWindowManager; if (mWindowManager != null) do something... -- View this message in context: http://mono-for-android.1047100.n5.nabble.com/IWindowManager-tp4845524p4845585.html Sent from the Mono for Andro

[mono-android] IWindowManager

2011-09-27 Thread tsukrov
Hi! This line crashes: mWindowManager = (IWindowManager)context.GetSystemService(Context.WindowService); Cannot cast from source type to destination type. -- View this message in context: http://mono-for-android.1047100.n5.nabble.com/IWindowManager-tp4845524p4845524.html Sent from th