如何在android中创建单按钮对话框? [英] How to create single button Dialog in android?

查看:19
本文介绍了如何在android中创建单按钮对话框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在寻找几天来试图弄清楚如何在我的应用程序中添加带有单个按钮的对话框.提前致谢!

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

推荐答案

Dialog很简单,或者是如何判断更新是否必要的问题?这里是 Dialogbuilder:

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();

我不知道如何在市场上检查更新,我建议将版本与您自己的网站进行比较,如果您在该网站上增加版本号,请致电市场下载最新版本或下载apk外部

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

这篇关于如何在android中创建单按钮对话框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆