Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. [SOLVED] Qt on Android : How to reset Inactivity Time ?
Forum Updated to NodeBB v4.3 + New Features

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

Scheduled Pinned Locked Moved Mobile and Embedded
2 Posts 1 Posters 1.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nologinma
    wrote on last edited by
    #1

    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 ?

    1 Reply Last reply
    0
    • N Offline
      N Offline
      nologinma
      wrote on last edited by
      #2

      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);

      }

      }@

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved