QAndroidServiceConnection 類

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

公共函數

QAndroidServiceConnection ()
QAndroidServiceConnection (const QAndroidJniObject & serviceConnection )
virtual ~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 ()

創建新對象

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 ()

Destroys the instance of QAndroidServiceConnection. The destructor is virtual.

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.

警告: 從 Binder 綫程 (不同於創建此對象的綫程) 調用此方法。

返迴下劃綫 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.

警告: 從 Binder 綫程 (不同於創建此對象的綫程) 調用此方法。

返迴下劃綫 QAndroidJniObject