綁定帳號登入

Android 台灣中文網

打印 上一主題 下一主題

[求助] 有關Service |Android 的程式碼問題

[複製連結] 查看: 1187|回覆: 2|好評: 0
跳轉到指定樓層
樓主
sheng0208 | 收聽TA | 只看該作者 回帖獎勵 |倒序瀏覽 |閱讀模式
發表於 2014-8-27 17:14

馬上加入Android 台灣中文網,立即免費下載應用遊戲。

您需要 登錄 才可以下載或查看,沒有帳號?註冊

x

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


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;
        }
「用Android 就來APK.TW」,快來加入粉絲吧!
Android 台灣中文網(APK.TW)
收藏收藏 分享分享 分享專題
用Android 就來Android 台灣中文網(https://apk.tw)
回覆

使用道具 舉報

沙發
firemaples | 收聽TA | 只看該作者
發表於 2014-9-6 09:05
由 手機網頁 發佈
sheng0208 發表於 2014-8-27 17:14因為我資質駑鈍  我想請問下面這段程式碼 是什麼意思 ???

你可以上網找一下AIDL的教學
這是一種在Activity遙控Service的一種方式
比較常見的範例是音樂播放器
用Android 就來Android 台灣中文網(https://apk.tw)
回覆 支持 反對

使用道具 舉報

板凳
ivan0910677567 | 收聽TA | 只看該作者
發表於 2014-11-10 19:37
由 手機網頁 發佈
sheng0208 發表於 2014-8-27 17:14因為我資質駑鈍  我想請問下面這段程式碼 是什麼意思 ???

好 軟体是一定要支持的 謝謝
用Android 就來Android 台灣中文網(https://apk.tw)
回覆 支持 反對

使用道具 舉報

您需要登錄後才可以回帖 登錄 | 註冊

本版積分規則