putExtra (QString, QString) doesn't seem to work for me

13 views
Skip to first unread message

sebasti...@web.de

unread,
Jul 31, 2021, 8:09:52 AM7/31/21
to android-qt

Hi,

I've got a problem with putting an extra into a pending intent. My goal is to have a program restart with parameters/arguments.

@QAndroidIntent realIntent(pendingIntent);realIntent.putExtra(QString("SCREEN"), QString("Camera"));
debugLog.write(QString("realIntent: "+realIntent.extraVariant("SCREEN").toString()+"\n").toLocal8Bit());@

...results in just "realIntent: " in my debugLog, whereas it should be "realIntent: Camera"


Please note, that pendingIntent is a QAndroidJniObject and debugLog is just a QFile.

For context: I am (successfully) using this approach for restart: https://www.kdab.com/qt-on-android-how-to-restart-your-application/

I need the extra (or any other way) to properly pass information to the restarted app.


I'm not sure what I am doing wrong. Any pointers welcome!

Best regards

Sebastian





-- 
http://www.classintouch.de - Tablet-Software für Lehrer
Reply all
Reply to author
Forward
0 new messages