我樂享優先共享偏好禁用對話框通知..在我的應用程序有鈴聲的Android
我想要把禁用通知短信,彩信和通知,像警報通知應用程序
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<CheckBoxPreference
android:title="Disable Notification"
android:defaultValue="true"
android:key="checkbox"
android:summary="Check the Box"/>
</PreferenceScreen>
這是我的對話框通知碼之一:
//Alert Code
final AlertDialog alertDialog = new AlertDialog.Builder(this).create();
alertDialog.setTitle("Reset...");
alertDialog.setMessage("Are you sure?");
Alert.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
// TODO Auto-generated method stub
alertDialog.setButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
// here you can add functions
}
});
alertDialog.setIcon(android.R.drawable.ic_dialog_alert);
alertDialog.show();
}
});
}
我嘗試運行它,但是當我與報警通知嘗試沒有成功
真的嗎?沒有答案? – user1257040 2012-04-11 18:43:54