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. QApplication inactive after start android app
Qt 6.11 is out! See what's new in the release blog

QApplication inactive after start android app

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
1 Posts 1 Posters 381 Views
  • 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.
  • E Offline
    E Offline
    Elnur_Ismailzada
    wrote on last edited by
    #1

    Hi!

    I have only one activity which inherited from QtActivity.
    For my application, I download the library from the server. In QLoader, if there are no local libs, then I call my service and download the libraries. After I call QLoader.loadApplication with prepared parameters for loading.
    The application starts, the qml interface is displayed and works. The problem is that some functionality does not work, such as showing a android keyboard, camera, WebView. I found that my application has the state Qt::ApplicationInactive. After minimizing and expanding the application, everything works correctly.
    On android, the focus is set to my activity.

    adb shell dumpsys window windows | grep -E 'mCurrentFocus|mFocusedApp'
      mCurrentFocus=Window{7b3f79 u0 org.example.mobile/org.example.mobile.MyActivity}
      mFocusedApp=AppWindowToken{2e8f778 token=Token{7066692 ActivityRecord{da8241d u0 org.example.mobile/.MyActuvuty t1132}}}
    
    

    Also for testing, before starting the application (QLoader.loadApplication) I create a new activity that is just finished. And it solves the problem. State changes to Qt::ApplicationActive

    Intent intent = new Intent(MyActivity.this, FixActivity.class);
    startActivity(intent);
    
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
    
            finish();
        }
    

    Does anyone know what the problem is?

    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