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. Get data in customActivity from Qt
Forum Updated to NodeBB v4.3 + New Features

Get data in customActivity from Qt

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
android
2 Posts 2 Posters 409 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.
  • A Offline
    A Offline
    Alioune
    wrote on last edited by
    #1

    Hi all
    I am new to QtAndroidExtra. I used the example of the QtCreator IDE "CustomActivity" and wanted to know if it is possible to get data in android custom activity from Qt for example
    Qstring myVar = "Hello World" and retrieve it in CustomActivity.java after its start
    String recvVar = myVar
    to use it in a method of the class

    1 Reply Last reply
    0
    • A Offline
      A Offline
      Alioune
      wrote on last edited by
      #2

      My question is I want to send data and retrieve it in java. for exeomple

      void ActivityHandler::activityReceiver(int requestCode, int resultCode, const QAndroidJniObject &data)
      {
      if (requestCode == REQUEST_CODE) {
      if (resultCode == RESULT_OK) {

              const QAndroidJniObject key = QAndroidJniObject::fromString("message");
      
              const QAndroidJniObject message = data.callObjectMethod(
                      "getData", "(Ljava/lang/String;)Ljava/lang/String;", key.object());
      
              if (message.isValid())
                  emit ActivityHandler::instance()->receiveFromActivityResult(message.toString());
          } else {
              emit ActivityHandler::instance()->receiveFromActivityResult("Rejected!");
          }
      }
      

      }

      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