タイトル通り、アプリ終了時にトーストメッセージを表示したいです。OnClickListenerの制約により、以下は使用できません。
btnExit.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
// close the application and turn off bluetooth
btAdapter.disable();
Toast.makeText(this, "Bluetooth is turned off.",
Toast.LENGTH_SHORT).show();
finish();
}
});
Bluetoothをオフにして、Bluetoothがオフになっていることを示すトーストを表示しながら、ボタンをクリックしてプログラムを終了できるようにしたい