[Android-development] using getwindow.setFlags from a JNI activity object
Fernando Pelliccioni
fpelliccioni at gmail.com
Thu Oct 2 22:56:19 CEST 2014
On Mon, Sep 29, 2014 at 5:05 PM, <maitai at virtual-winds.org> wrote:
> Hello,
>
> I'm trying to set/clear FLAG_KEEP_SCREEN_ON when GPS positionning is
> activated/deactivated. I read that I should be doing something like
>
> activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
>
> So I'm trying to get an activity instance with
> QAndroidJniObject qtActivity = QtAndroid::androidActivity();
> or
> QAndroidJniObject qtActivity =
>
> QAndroidJniObject::callStaticObjectMethod("org/qtproject/qt5/android/QtNative",
> "activity", "()Landroid/app/Activity;");
>
> and then no luck, whatever I tried concerning callMethod() and
> similar....
>
> Any clue?
>
> Thanks
> Philippe Lelong
> _______________________________________________
> Android-development mailing list
> Android-development at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/android-development
>
Hi,
I'm stuck with the same problem.
All the Java examples I saw, set the FLAG_KEEP_SCREEN_ON flag on the
onCreate() method of the Activity subclass, like:
public class MyActivity extends Activity {
//...
@Override
protected void onCreate(Bundle x) {
super.onCreate(x);
//...
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
//...
}
}
How can we inherit from QtActivity and put code on the onCreate() function?
(in Qt 5.3)
Thanks and regards,
Fernando Pelliccioni.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/android-development/attachments/20141002/afc6b622/attachment.html>
More information about the Android-development
mailing list