| 頭: | #include <QAndroidIntent> |
| qmake: | QT += androidextras |
| Since: | Qt 5.10 |
| QAndroidIntent () | |
| QAndroidIntent (const QAndroidJniObject & intent ) | |
| QAndroidIntent (const QString & action ) | |
| QAndroidIntent (const QAndroidJniObject & packageContext , const char * className ) | |
| virtual | ~QAndroidIntent () |
| QByteArray | extraBytes (const QString & key ) |
| QVariant | extraVariant (const QString & key ) |
| QAndroidJniObject | 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 Java 對象。
創建新的意圖並設置提供的 action .
創建新的意圖並設置提供的 packageContext 和服務 className 。範例:
auto serviceIntent = QAndroidIntent(QtAndroid::androidActivity().object(), "com.example.MyService");
另請參閱 QtAndroid::androidActivity and QtAndroid::bindService .
[虛擬]
QAndroidIntent::
~QAndroidIntent
()
Destroys the instance of QAndroidIntent. The destructor is virtual.
返迴額外 key 數據從額外意圖
返迴額外 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.