###前提・実現したいこと
BluetoothChatに手を加えて通信が切れたら別のAvtivityを開くようにしたいです。
Intentを使用して、ボタンで画面を切り替える簡単なプログラムはできていますが、BluetoothChatFragment.javaの中に入れるとエラーになります。
###発生している問題・エラーメッセージ
Cannot resolve constructor 'Intent(com.exsample.android.bluetoothchat.BluetoothChatFragment, java.lang.Class<com.example.android.bluetoothchat.SubActivity>)'
###該当のソースコード
BluetoothChatFragment.javaのHandlerのSwich case文内です。
case BluetoothChatService.STATE_NONE: setStatus(R.string.title_not_connected); //Intentのインスタンス生成 Intent intent = new Intent(BluetoothChatFragment.this, SubActivity.class); // 次画面のアクティビティ起動 startActivity(intent); break;
###試したこと
BluetoothChatFragment.thisを変えたりしましたが、どれもエラーになります。
###補足情報(言語/FW/ツール等のバージョンなど)
Android Studio 2.2.3
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/02/12 07:41
2017/02/12 08:21