QAndroidService 类

头: #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 方法。

成员函数文档编制

QAndroidService:: QAndroidService ( int & argc , char ** argv )

创建新的 Android Service,传递 argc and argv 作为参数。

另请参阅 QCoreApplication .

QAndroidService:: QAndroidService ( int & argc , char ** argv , const std::function < QAndroidBinder *(const QAndroidIntent &)> & binder )

创建新的 Android Service,传递 argc and argv 作为参数。

binder 用于创建 binder 当需要时。

另请参阅 QCoreApplication .

[virtual] QAndroidService:: ~QAndroidService ()

Destroys the instance of QAndroidService. The destructor is virtual.

[virtual] QAndroidBinder *QAndroidService:: onBind (const QAndroidIntent & intent )

The user must override this method and to return a binder.

The intent parameter contains all the caller information.

The returned binder is used by the caller to perform IPC calls.

警告: This method is called from Binder's thread which is different from the thread that this object was created.

另请参阅 QAndroidBinder::onTransact and QAndroidBinder::transact .