作者nsysukober (安安)
看板AndroidDev
標題[問題] BluetoothChat sample 閃退?
時間Wed Nov 26 01:54:23 2014
請問一下各位大大
為什麼我是用 android 的 BluetoothChat sample code
當載到手機之後開啟就會crash
有上網找過,發現還是無法解決... 手機版本為 4.0.3
以下為目前的code
https://www.dropbox.com/sh/fqhhaufz3c776m0/AACgzFcaAMWKSlvHKxQS1jzVa?dl=0
謝謝各位@@
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 140.117.176.202
※ 文章網址: http://webptt.com/m.aspx?n=bbs/AndroidDev/M.1416938067.A.A2C.html
1F:推 elysium5290: 權限 11/26 18:04
2F:→ nsysukober: 是那個name 什麼的嗎? 請問有關鍵字可以查嗎? 11/26 18:55
3F:→ nsysukober: 搜不太到QQ 11/26 18:55
目前前面文章,解決閃退問題了,但是... 一開起來不是閃退而是
"很抱歉 bluetooth 已停止",查了一下好像是"版本問題",但我的min設15,max設18
理論上是沒問題阿QAQ
我已經試過超多組的了,連target也有設還是不行... 真心覺得android好腦人阿QQ
PS : 手機說需要更新,請問有無更新有差嗎@@?
code已更新
4F:→ passli: 你應該是要po logcat的資訊 才知道是什麼錯誤阿 11/27 15:00
恩恩,解決嚕
提供給以後的人參考,主要是改 BluetoothChat.java 的
public void onCreate(Bundle savedInstanceState)
這邊他官方的有點問題
BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
這行應改為 mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
就OK嚕
※ 編輯: nsysukober (140.117.176.202), 11/27/2014 20:28:12