[SOLVED] Qt on Android : How to reset Inactivity Time ?



  • When I developed with symbian to reset the Inactivity Time I used the the following comand:

    @User::ResetInactivityTime();@

    But I haven't found nothing for Android.

    Do you have a response ?



  • The solution is call the java class from qt c++ program using JNI class and the java class is the following:

    @//
    // Next72Utility.java
    //
    package org.qtproject.example.Chronometer;

    import android.content.Context;
    import android.app.Activity;
    import android.view.WindowManager;
    import android.view.WindowManager.LayoutParams;
    import android.os.Bundle;

    public class Next72Utility extends org.qtproject.qt5.android.bindings.QtActivity
    {

    public static Next72Utility m_istance;

    public Next72Utility()
    {
    m_istance = this;
    }

    public void onCreate(Bundle savedInstanceState)
    {
    super.onCreate(savedInstanceState);
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON,
    WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);

    }

    }@


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.