Wraps the most important methods of Android Intent class. 更多...
头: | #include <QAndroidIntent> |
CMake: |
find_package(Qt6 COMPONENTS Core REQUIRED)
target_link_libraries(mytarget PRIVATE Qt6::Core) |
qmake: | QT += core |
Since: | Qt 6.2 |
该类在开发且可能改变。
QAndroidIntent (const QJniObject & packageContext , const char * className ) | |
QAndroidIntent (const QString & action ) | |
QAndroidIntent (const QJniObject & intent ) | |
QAndroidIntent () | |
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 ) |
The QAndroidIntent is a convenience class that wraps the most important Android Intent 方法。
Creates a new intent and sets the provided packageContext and the service className 。范例:
auto serviceIntent = QAndroidIntent(QtAndroidPrivate::androidActivity().object(), "com.example.MyService");
另请参阅 QtAndroidPrivate::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
设置 key 采用 data in the Intent extras
设置 key 采用 value in the Intent extras.