How to create single button Dialog in android?

前端 未结 2 2172
隐瞒了意图╮
隐瞒了意图╮ 2020-12-11 10:57

I have been searching for days trying to figure out how to add dialog with single button in my application. Thanks in advance!

2条回答
  •  孤街浪徒
    2020-12-11 11:40

    The Dialog is simple, or is the question how to determine if a update is nessecary? Here the Dialogbuilder:

    AlertDialog.Builder builder = new AlertDialog.Builder(FisMapView.this);
                            builder.setTitle("Update required");
                            builder.setPositiveButton("UPDATE", new DialogInterface.OnClickListener() {                     
                                @Override
                                public void onClick(DialogInterface dialog, int which) {
    
                                } 
                            });
    
                            builder.setNeutralButton("Abort", null);
                            AlertDialog alert = builder.create();
                            alert.show();
    

    edit: I can't figure out how to check for updates in the market, i would suggest to compare the version with a website of your own, if you increase the versionnumber on this site, call the market to download the newest version or download the apk externally

提交回复
热议问题