QAndroidIntent Class

Umfasst die wichtigsten Methoden der Android Intent Klasse. Mehr...

Kopfzeile: #include <QtCore/private/qandroidextras_p.h>
CMake: find_package(Qt6 REQUIRED COMPONENTS Core)
target_link_libraries(mytarget PRIVATE Qt6::CorePrivate)
qmake: QT += core-private
Seit: Qt 6.2
Status: Vorläufig

Diese Klasse befindet sich in der Entwicklung und kann sich noch ändern.

Öffentliche Funktionen

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)

Detaillierte Beschreibung

QAndroidIntent ist eine Komfortklasse, die die wichtigsten Android-Intent-Methoden umschließt.

Dokumentation der Mitgliedsfunktionen

QAndroidIntent::QAndroidIntent()

Erstellen Sie eine neue Absicht

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

Verpackt das bereitgestellte intent java-Objekt.

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

Erzeugt einen neuen Intent und setzt den angegebenen action.

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

Legt einen neuen Intent an und setzt die angegebene packageContext und den Dienst className. Beispiel:

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

Siehe auch QtAndroidPrivate::bindService.

QByteArray QAndroidIntent::extraBytes(const QString &key)

Gibt die zusätzlichen key Daten aus den Intent-Extras zurück

QVariant QAndroidIntent::extraVariant(const QString &key)

Gibt die zusätzlichen key Daten aus den Intent-Extras als QVariant

QJniObject QAndroidIntent::handle() const

Der Rückgabewert ist nützlich, um andere Java-APIs aufzurufen, die nicht von diesem Wrapper abgedeckt werden

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

Setzt die key mit der data in die Intent-Extras

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

Setzt die key mit der value in die Intent-Extras.

© 2025 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.