14
我要建立自己的對話框notifiy應用程序沒有達到互聯網用戶,而我打算把它兩個按鈕。設置和取消,因爲它在許多其他應用程序可見。如何直接啓動設置在無線和網絡頁面?
我現在想知道,如何開展直接在無線網絡&頁面設置?
我要建立自己的對話框notifiy應用程序沒有達到互聯網用戶,而我打算把它兩個按鈕。設置和取消,因爲它在許多其他應用程序可見。如何直接啓動設置在無線和網絡頁面?
我現在想知道,如何開展直接在無線網絡&頁面設置?
/**
* Display a dialog that user has no internet connection
* @param ctx1
*
* Code from: http://osdir.com/ml/Android-Developers/2009-11/msg05044.html
*/
public static void showNoConnectionDialog(Context ctx1) {
final Context ctx = ctx1;
AlertDialog.Builder builder = new AlertDialog.Builder(ctx);
builder.setCancelable(true);
builder.setMessage(R.string.no_connection);
builder.setTitle(R.string.no_connection_title);
builder.setPositiveButton(R.string.settings, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
ctx.startActivity(new Intent(Settings.ACTION_WIRELESS_SETTINGS));
}
});
builder.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
return;
}
});
builder.setOnCancelListener(new DialogInterface.OnCancelListener() {
public void onCancel(DialogInterface dialog) {
return;
}
});
builder.show();
}
這真的非常有幫助,我也實現了與你的相同。不過還是可以請你幫我整理出來:http://stackoverflow.com/questions/3889241/wireless-settings-dialog – 2011-08-30 07:04:04