QAndroidServiceConnection 类

包裹 Android ServiceConnection 类的最重要方法。 更多...

头: #include <QAndroidServiceConnection>
qmake: QT += androidextras
Since: Qt 5.10

该类在 Qt 5.10 引入。

公共函数

QAndroidServiceConnection (const QAndroidJniObject & serviceConnection )
QAndroidServiceConnection ()
QAndroidJniObject handle () const
virtual void onServiceConnected (const QString & name , const QAndroidBinder & serviceBinder ) = 0
virtual void onServiceDisconnected (const QString & name ) = 0

详细描述

The QAndroidServiceConnection is a convenience abstract class which wraps the Android ServiceConnection 接口。

它很有用当履行 QtAndroid::bindService 操作。

成员函数文档编制

QAndroidServiceConnection:: QAndroidServiceConnection (const QAndroidJniObject & serviceConnection )

创建新的对象从现有 serviceConnection .

It's useful when you have your own Java implementation. Of course onServiceConnected ()/ onServiceDisconnected () will not be called anymore.

QAndroidServiceConnection:: QAndroidServiceConnection ()

创建新对象

QAndroidJniObject QAndroidServiceConnection:: handle () const

返回下划线 QAndroidJniObject

[pure virtual] void QAndroidServiceConnection:: onServiceConnected (const QString & name , const QAndroidBinder & serviceBinder )

This notification is called when the client managed to connect to the service. The name contains the server name, the serviceBinder is the binder that the client uses to perform IPC operations.

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

返回下划线 QAndroidJniObject

[pure virtual] void QAndroidServiceConnection:: onServiceDisconnected (const QString & name )

Called when a connection to the Service has been lost. The name parameter specifies which connectioen was lost.

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

返回下划线 QAndroidJniObject