忘れがちなのでメモしておきます。
操作にSEを付ける場合、既存の操作音とかぶって邪魔するので消したい時などに。
動的にOFFすするにはwidgetに対して
xmlファイルでOFFするには、
Eclipseのプロパティでは、「Show Advanced Properties」をクリックしないと出て来ないかもしれません。
追記:2014/10/05
ダイアログなどの場合は、AlertDialogからViewを取得して、setSoundEffectsEnabledをすれば良いようです。
ボタン操作音の場合は、以下のようにViewを取得します。
参考
android - How to disable system sound effect on AlertDialog? - Stack Overflow http://stackoverflow.com/questions/13952495/how-to-disable-system-sound-effect-on-alertdialog
操作にSEを付ける場合、既存の操作音とかぶって邪魔するので消したい時などに。
動的にOFFすするにはwidgetに対して
setSoundEffectsEnabled(false);
xmlファイルでOFFするには、
android:soundEffectsEnabled=false
Eclipseのプロパティでは、「Show Advanced Properties」をクリックしないと出て来ないかもしれません。
追記:2014/10/05
ダイアログなどの場合は、AlertDialogからViewを取得して、setSoundEffectsEnabledをすれば良いようです。
AlertDialog.Builder builder = new AlertDialog.Builder(act); builder.setSingleChoiceItems(R.array.entries_list, index, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { } }); AlertDialog dialog = builder.create(); ListView list = dialog.getListView(); list.setSoundEffectsEnabled(false); dialog.show();
ボタン操作音の場合は、以下のようにViewを取得します。
Button btn = dialog.getButton(Dialog.BUTTON_POSITIVE);
参考
android - How to disable system sound effect on AlertDialog? - Stack Overflow http://stackoverflow.com/questions/13952495/how-to-disable-system-sound-effect-on-alertdialog
コメント
コメントを投稿