The issue is with the aView(), not autoclass.
And the error is "No constructor matching your arguments", if you check
the android documentation, you'll see that yes, you cannot instanciate a
View with no argument. At least, you need to pass the Context.
This is the second time i'm reading an issue like that this week, just
because users don't read the android documentation :)
As for creating a view just to get the current activity, this is wrong.
Using kivy/python-for-android, right now (this might change in the
future), you can get the activity/context instance with:
PythonActivity = autoclass('org.renpy.android.PythonActivity')
context = PythonActivity.mActivity
-> context is an instance of an Activity class, and Activity subclass
Context.
From that point, you can do context.getWindow().getDecorView() etc.
Good luck!
Le 03/12/2013 19:44,
hci...@gmail.com a �crit :
> The code bellow is what I've tried. But it gives me the following error
> when I run it on the device, which is a Nexus 7 running android 4.4:
>
> "/main.py", line 84, in build
> I/python (12461): File "jnius_export_class.pxi", line 147, in
> jnius.jnius.JavaClass.__init__ (jnius/jnius.c:10916)
> I/python (12461): File "jnius_export_class.pxi", line 199, in
> jnius.jnius.JavaClass.call_constructor (jnius/jnius.c:11757)
> I/python (12461): jnius.jnius.JavaException: _/No constructor matching
> your arguments/_
>
> I assume this means that it can't find the 'android.view.View' class?
> That seems weird because that is a standard class with android.
>
>
> |
> fromjnius importautoclass
>
> # Set to immersive mode on Android
> aView =autoclass('android.view.View')# This is line 84 where the
> error is
> view =aView()
> decorView =aView.getActivity.getWindow.getDecorView()
>
> # Set options for view
> uiOptions =view.SYSTEM_UI_FLAG_LAYOUT_STABLE
> uiOptions +=view.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
> uiOptions +=view.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
> uiOptions +=view.SYSTEM_UI_FLAG_HIDE_NAVIGATION
> uiOptions +=view.SYSTEM_UI_FLAG_FULLSCREEN
> uiOptions +=view.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
>
> # Set view to options
> decorView.setSystemUiVisibility(uiOptions)
>
> |
>
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Kivy users support" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
kivy-users+...@googlegroups.com.
> For more options, visit
https://groups.google.com/groups/opt_out.