Next: Qt on Android : How to reset Inactivity Time

Qt on Android : How to reset Inactivity Time

Publish the new topic about "how to rest Inactivity Time" for Android form QT

Here the java class called by JNI

  1. //
  2. // Next72Utility.java
  3. //
  4. package org.qtproject.example.Chronometer;
  5.  
  6. import android.content.Context;
  7. import android.app.Activity;
  8. import android.view.WindowManager;
  9. import android.view.WindowManager.LayoutParams;
  10. import android.os.Bundle;
  11.  
  12. public class Next72Utility extends org.qtproject.qt5.android.bindings.QtActivity
  13. {
  14.  
  15.    public static Next72Utility m_istance;
  16.  
  17.  
  18.    public Next72Utility()
  19.    {
  20.        m_istance = this;
  21.    }
  22.  
  23.  
  24.    public void onCreate(Bundle savedInstanceState)
  25.    {
  26.        super.onCreate(savedInstanceState);
  27.        getWindow().setFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON,
  28.                                         WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
  29.    }
  30.  
  31. }

Here the link to post