IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

QAndroidIntent Class

Wraps the most important methods of Android Intent class.

This class was introduced in Qt 6.2.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

QAndroidIntent Class

  • Header: QtCore/private/qandroidextras_p.h

  • Since: Qt 6.2

  • qmake: QT += core-private

This class is under development and is subject to change.

Detailed Description

The QAndroidIntent is a convenience class that wraps the most important Android Intent methods.

When building with CMake, use the following commands to use private Qt Core APIs:

 
Sélectionnez
find_package(Qt6 REQUIRED COMPONENTS Core)
target_link_libraries(mytarget PRIVATE Qt6::CorePrivate)

Member Function Documentation

 

QAndroidIntent::QAndroidIntent()

Create a new intent

[explicit] QAndroidIntent::QAndroidIntent(const int &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 int &packageContext, const char *className)

Creates a new intent and sets the provided packageContext and the service className. Example:

 
Sélectionnez
auto serviceIntent = QAndroidIntent(QtAndroidPrivate::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

int 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.

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+