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. [Android] Open dialog when notification gets clicked
Forum Updated to NodeBB v4.3 + New Features

[Android] Open dialog when notification gets clicked

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
4 Posts 2 Posters 2.3k Views 2 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.
  • S Offline
    S Offline
    Schluchti
    wrote on 30 Aug 2016, 10:58 last edited by
    #1

    Hi,

    Is there a possibility to open a dialog window instead of the application when a new push notification is received? I already got push notifications to work, but instead of opening the app in fullscreen mode when the notification gets clicked I want to only show a dialog (like a quick reply dialog). So basically I want something similar to this: http://stackoverflow.com/questions/19080511/how-to-send-reply-from-expandable-notification-in-android

    When the user clicks on "Reply" a "quick reply dialog" opens where the user can quickly reply to the message. Is that dialog thing possible with Qt?

    Any help is really appreciated.
    Thanks for your time,
    Bernhard

    Want to read more about Qt?

    https://gympulsr.com/blog/qt/

    Latest Article: https://gympulsr.com/blog/qt/2017/06/14/ios-background-music-qt.html

    1 Reply Last reply
    0
    • S Offline
      S Offline
      Schluchti
      wrote on 30 Aug 2016, 16:05 last edited by
      #2

      After reading a bit more, it looks like that I would need multiple activites for that? But is that possible with Qt?

      What I was also thinking was to somehow pass a parameter to the Qt application when it gets started to tell the applocation if it should behave as a dialog or full application. But I don't know if that's somehow possible?

      Best regards,
      Bernhard

      Want to read more about Qt?

      https://gympulsr.com/blog/qt/

      Latest Article: https://gympulsr.com/blog/qt/2017/06/14/ios-background-music-qt.html

      1 Reply Last reply
      0
      • B Offline
        B Offline
        BogDan Vatra
        wrote on 7 Sept 2016, 07:58 last edited by
        #3

        It's possible to have multiple qt activities as long as they are running in separate processes (check https://developer.android.com/guide/topics/manifest/activity-element.html#proc).
        It is also possible to pass some parameters to the main function to distinct from the "normal" activity.

        So the steps are:

        • copy the <activity ... >...</activity> element.
        • add android:process=":unique_tag" attribute to the activity element
        • add " <meta-data android:name="android.app.arguments" android:value="-dialog"/> element to the activity element

        BogDan.

        S 1 Reply Last reply 8 Sept 2016, 19:33
        1
        • B BogDan Vatra
          7 Sept 2016, 07:58

          It's possible to have multiple qt activities as long as they are running in separate processes (check https://developer.android.com/guide/topics/manifest/activity-element.html#proc).
          It is also possible to pass some parameters to the main function to distinct from the "normal" activity.

          So the steps are:

          • copy the <activity ... >...</activity> element.
          • add android:process=":unique_tag" attribute to the activity element
          • add " <meta-data android:name="android.app.arguments" android:value="-dialog"/> element to the activity element

          BogDan.

          S Offline
          S Offline
          Schluchti
          wrote on 8 Sept 2016, 19:33 last edited by Schluchti 9 Aug 2016, 19:34
          #4

          @BogDan-Vatra

          First of all, many thanks for helping me with this, Bogdan!

          I tried it, and it worked! am really happy now.

          The only problem left is, that the Activity always starts in fullscreen mode. I tried to use Window and ApplicationWindow as root object for the popup dialog, but no matter which height/width I set via QML, it always opens in fullscreen. Do you know maybe also know how I can accomplish that?

          My gut feeling is, that I need to modify the AndroidManifest somehow, but I haven't found anything yet.

          Many thanks!

          Want to read more about Qt?

          https://gympulsr.com/blog/qt/

          Latest Article: https://gympulsr.com/blog/qt/2017/06/14/ios-background-music-qt.html

          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