| 头: | #include <QAndroidService> |
| qmake: | QT += androidextras |
| Since: | Qt 5.10 |
| 继承: | QCoreApplication |
| QAndroidService (int & argc , char ** argv ) | |
| QAndroidService (int & argc , char ** argv , const std::function<QAndroidBinder *(const QAndroidIntent &)> & binder ) | |
| virtual | ~QAndroidService () |
| virtual QAndroidBinder * | onBind (const QAndroidIntent & intent ) |
The QAndroidService is a convenience class that wraps the most important Android Service 方法。
创建新 Android Service 传递 argc and argv 作为参数。
另请参阅 QCoreApplication .
创建新 Android Service 传递 argc and argv 作为参数。
binder 用于创建 binder 当需要时。
另请参阅 QCoreApplication .
[虚拟]
QAndroidService::
~QAndroidService
()
Destroys the instance of QAndroidService. The destructor is virtual.
[虚拟]
QAndroidBinder
*QAndroidService::
onBind
(const
QAndroidIntent
&
intent
)
用户必须覆写此方法并返回 Binder。
The intent 参数包含所有调用者信息。
返回的 Binder 用于调用者以履行 IPC (进程间通信) 调用。
警告: 从 Binder 线程 (不同于创建此对象的线程) 调用此方法。
另请参阅 QAndroidBinder::onTransact and QAndroidBinder::transact .