Android 台灣中文網

標題: 有關Service |Android 的程式碼問題 [打印本頁]

作者: sheng0208    時間: 2014-8-27 17:14
標題: 有關Service |Android 的程式碼問題

因為我資質駑鈍  我想請問下面這段程式碼 是什麼意思 ???


private final IBinder mcBinder = new FriendChatBinder();

       
        // this is binder
        public class FriendChatBinder extends Binder {
                public IFriendChatService getService() {
                        return FriendChatService.this;
                }               
        }
       
        @Override
        public IBinder onBind(Intent arg0) {
                // TODO 自動產生的方法 Stub
                if(heartbeat == null){
                        heartbeat = new Timer();       
                }
               
                return mcBinder;
        }
作者: firemaples    時間: 2014-9-6 09:05
sheng0208 發表於 2014-8-27 17:14因為我資質駑鈍  我想請問下面這段程式碼 是什麼意思 ???

你可以上網找一下AIDL的教學
這是一種在Activity遙控Service的一種方式
比較常見的範例是音樂播放器
作者: ivan0910677567    時間: 2014-11-10 19:37
sheng0208 發表於 2014-8-27 17:14因為我資質駑鈍  我想請問下面這段程式碼 是什麼意思 ???

好 軟体是一定要支持的 謝謝




歡迎光臨 Android 台灣中文網 (https://apk.tw/) Powered by Discuz! X3.1