アプリケーションで 2 台の電話を Bluetooth で接続しようとしています。私はこのチュートリアルを使用しています: http://developer.android.com/guide/topics/connectivity/bluetooth.htmlですが、うまくいかないので何か間違ったことをしなければなりません。「Bluetooth の有効化ダイアログ」を表示したい:
private static final int REQUEST_ENABLE_BT = 1;
[...]
BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
if (mBluetoothAdapter == null) {
Log.v("BC", "Your device don't have bt");
}
if (!mBluetoothAdapter.isEnabled()) {
Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
startActivityForResult(enableBtIntent, REQUEST_ENABLE_BT);
}
エラーがあります:
10-11 20:03:48.640: E/AndroidRuntime(32041): 致命的な例外: スレッド-3652 10-11 20:03:48.640: E/AndroidRuntime(32041): java.lang.NullPointerException 10-11 20:03: 48.640: E/AndroidRuntime(32041): android.app.Activity.startActivityForResult(Activity.java:3190) 10-11 20:03:48.640: E/AndroidRuntime(32041): pl.piotrek.panitball.BluetoothConnection.urchamianie で(BluetoothConnection.java:24) 10-11 20:03:48.640: E/AndroidRuntime(32041): pl.piotrek.panitball.MainClass.doDraw(MainClass.java:86) 10-11 20:03:48.640: E /AndroidRuntime(32041): pl.piotrek.panitball.ViewThread.run(ViewThread.java:32) で Blockquote
どうしたの?!