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

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

问题描述

我一直在寻找了几天,试图找出如何使用一个按钮在我的应用程序中添加对话框。在此先感谢!

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

推荐答案

对话很简单,要么就是问题如何确定一个更新nessecary?
在这里,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();

编辑:
我无法弄清楚如何检查在市场上的更新,我会建议的版本与你自己的网站相比,如果增加在本网站上的versionNumber,呼吁市场下载最新版或下载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天全站免登陆