QAndroidIntent Class▲
-
Header: QAndroidIntent
-
Since: Qt 5.10
-
qmake: QT += androidextras
Detailed Description▲
The QAndroidIntent is a convenience class that wraps the most important Android Intent methods.
Member Function Documentation▲
QAndroidIntent::QAndroidIntent()▲
Create a new intent
[explicit] QAndroidIntent::QAndroidIntent(const QAndroidJniObject &intent)▲
Wraps the provided intent java object.
[explicit] QAndroidIntent::QAndroidIntent(const QString &action)▲
Creates a new intent and sets the provided action.
[explicit] QAndroidIntent::QAndroidIntent(const QAndroidJniObject &packageContext, const char *className)▲
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▲
QByteArray QAndroidIntent::extraBytes(const QString &key)▲
Returns the extra key data from the Intent extras
QVariant QAndroidIntent::extraVariant(const QString &key)▲
Returns the extra key data from the Intent extras as a QVariant
QAndroidJniObject QAndroidIntent::handle() const▲
The return value is useful to call other Java API which are not covered by this wrapper
void QAndroidIntent::putExtra(const QString &key, const QByteArray &data)▲
Sets the key with the data in the Intent extras
void QAndroidIntent::putExtra(const QString &key, const QVariant &value)▲
Sets the key with the value in the Intent extras.