2013-12-12 35 views
-2
final BroadcastReceiver ActionFoundReceiver1 = new BroadcastReceiver(){ 
    @Override 
    public void onReceive(Context context, Intent intent) { 
     String action = intent.getAction(); 
     if(BluetoothDevice.ACTION_FOUND.equals(action)) { 
     BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE); 
     out = (TextView) findViewById (R.id.deviceName); 
     out.setText(device.getName()); 
     btDeviceList.add(device); 
     } 
    } 
} 
+0

什麼是你的問題? – Constantin

+0

當我打開應用程序,它掃描,但它不顯示任何東西在我的文字瀏覽。 – Cindy2011

+0

@ Cindy2011,請編輯您的原始問題並提供必要的信息。 –

回答

0

確定onReceive函數被調用嗎?嘗試在裏面打印一些調試文本。

如果它被調用時,嘗試添加

out = (TextView) findViewById (R.id.deviceName); 
out.setText(device.getName()); 
out.invalidate(); // Add this