2
私はAlertDialogをいくつかのアクティビティで使用する必要があります。独自のクラスでこれをどのように達成できますか?ありがとうございました!〜!複数のアクティビティで使用される1つのAlertDialog?
私は次のことをしようとした活動ワットで、それをアクセスも:
Alerts.sdCardMissing();
私が作成する 'しようとした' クラス:
public class Alerts {
public static void sdCardMissing() {
AlertDialog alertDialog = new AlertDialog.Builder(null).create();
alertDialog.setTitle("External Storage State");
alertDialog
.setMessage("Your SD-Card is not mounted! If the device is plugged into a computer via the USB, please disconect the device.");
alertDialog.setButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
// this.finish();
}
});
// alertDialog.setIcon(R.drawable.icon);
alertDialog.show();
}
}
Thnx @MisterSquonk !!それがそれでした。 – CelticParser
@camelCaser:助けになるのはうれしい。 – Squonk
あなたは、その答えがこれだけ単純であることを理解するために問題を突き抜けたその時代を知っていますか? <3 SOF – Jacksonkr