这是我的 AIDL PlayerHandleService.aidl:
interface PlayerHandleService {
void changeTextView();
}
我的活动上的 oncreate():Player_Activity:
@Override
protected void onCreate(Bundle savedInstanceState) {
this.bindService(new Intent(this,PlayerService.class), mConnection, Context.BIND_AUTO_CREATE);
}
mConnection:
private ServiceConnection mConnection = new ServiceConnection() {
@Override
public void onServiceDisconnected(ComponentName name) {
// TODO Auto-generated method stub
mpInterface=null;
}
@Override
public void onServiceConnected(ComponentName name, IBinder service) {
// TODO Auto-generated method stub
mpInterface = PlayerHandleService.Stub.asInterface(service);
}
};
现在,在我的活动(Player_Activity)上有一个 TextView,我想使用 AIDL 中的方法 changeTextView() 来更改该 TextView 的内容,我该怎么做?