In questa pagina

QAndroidIntent Class

Racchiude i metodi più importanti della classe Intent di Android. Altro...

Intestazione: #include <QtCore/private/qandroidextras_p.h>
CMake: find_package(Qt6 REQUIRED COMPONENTS CorePrivate)
target_link_libraries(mytarget PRIVATE Qt6::CorePrivate)
qmake: QT += core-private
A partire da: Qt 6.2
Stato: Anteprima tecnologica

Questa classe è in anteprima tecnologica ed è soggetta a modifiche.

Funzioni pubbliche

QAndroidIntent()
QAndroidIntent(const QJniObject &intent)
QAndroidIntent(const QString &action)
QAndroidIntent(const QJniObject &packageContext, const char *className)
QByteArray extraBytes(const QString &key)
QVariant extraVariant(const QString &key)
QJniObject handle() const
void putExtra(const QString &key, const QByteArray &data)
void putExtra(const QString &key, const QVariant &value)

Descrizione dettagliata

QAndroidIntent è una classe di utilità che racchiude i metodi più importanti di Android Intent.

Documentazione delle funzioni membro

QAndroidIntent::QAndroidIntent()

Crea un nuovo intento

[explicit] QAndroidIntent::QAndroidIntent(const QJniObject &intent)

Avvolge l'oggetto Java " intent " fornito.

[explicit] QAndroidIntent::QAndroidIntent(const QString &action)

Crea un nuovo intento e imposta l'action e specificato.

[explicit] QAndroidIntent::QAndroidIntent(const QJniObject &packageContext, const char *className)

Crea un nuovo intento e imposta l’ packageContext e specificato e il servizio className. Esempio:

auto serviceIntent = QAndroidIntent(QtAndroidPrivate::androidActivity().object(), "com.example.MyService");

Vedi anche QtAndroidPrivate::bindService.

QByteArray QAndroidIntent::extraBytes(const QString &key)

Restituisce i dati aggiuntivi " key " dagli "extras" dell'Intent

QVariant QAndroidIntent::extraVariant(const QString &key)

Restituisce i dati " key " presenti negli "extras" dell'Intent come un QVariant

QJniObject QAndroidIntent::handle() const

Il valore restituito è utile per richiamare altre API Java non coperte da questo wrapper

void QAndroidIntent::putExtra(const QString &key, const QByteArray &data)

Imposta l'key e utilizzando l'data e presente negli extra dell'Intent

void QAndroidIntent::putExtra(const QString &key, const QVariant &value)

Imposta l'key e con l'value e negli extras dell'Intent.

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.