Wraps the most important methods of Android Intent class. More...
Header: | #include <QAndroidIntent> |
qmake: | QT += androidextras |
Since: | Qt 5.10 |
This class was introduced in Qt 5.10.
QAndroidIntent(const QAndroidJniObject &packageContext, const char *className) | |
QAndroidIntent(const QString &action) | |
QAndroidIntent(const QAndroidJniObject &intent) | |
QAndroidIntent() | |
QByteArray | extraBytes(const QString &key) |
QVariant | extraVariant(const QString &key) |
QAndroidJniObject | handle() const |
void | putExtra(const QString &key, const QByteArray &data) |
void | putExtra(const QString &key, const QVariant &value) |
The QAndroidIntent is a convenience class that wraps the most important Android Intent methods.
Creates a new intent and sets the provided packageContext and the service className. Example:
auto serviceIntent = QAndroidIntent(QtAndroid::androidActivity().object(), "com.example.MyService");
See also QtAndroid::androidActivity and QtAndroid::bindService.
Creates a new intent and sets the provided action.
Wraps the provided intent java object.
Create a new intent
Returns the extra key data from the Intent extras
Returns the extra key data from the Intent extras as a QVariant
The return value is useful to call other Java API which are not covered by this wrapper
Sets the key with the data in the Intent extras
Sets the key with the value in the Intent extras.
© The Qt Company Ltd
Licensed under the GNU Free Documentation License, Version 1.3.
https://doc.qt.io/qt-5.15/qandroidintent.html