<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/custom_dialog_layout_design_user_input"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="16dp"> <TextView
android:id="@+id/dialogTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="输入数字"
android:textAppearance="?android:attr/textAppearanceLarge" /> <EditText
android:id="@+id/userInputDialog"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="输入数字"
android:inputType="number" />
</LinearLayout>

Java //gisoracle

 String str = "";

    private void showInputDialog() {

        LayoutInflater layoutInflaterAndroid = LayoutInflater.from(this);
View mView = layoutInflaterAndroid.inflate(R.layout.input_dialog, null);
AlertDialog.Builder alertDialogBuilderUserInput = new AlertDialog.Builder(this);
alertDialogBuilderUserInput.setView(mView); final EditText userInputDialogEditText = (EditText) mView.findViewById(R.id.userInputDialog);
alertDialogBuilderUserInput
.setCancelable(false)
.setPositiveButton("确定", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialogBox, int id) {
str = userInputDialogEditText.getText().toString();
YLPub.ShowMessage(str);
}
}) .setNegativeButton("取消",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialogBox, int id) {
dialogBox.cancel();
}
}); AlertDialog alertDialogAndroid = alertDialogBuilderUserInput.create();
alertDialogAndroid.show(); }

andriod inputbox的更多相关文章

  1. Andriod 自定义控件之创建可以复用的组合控件

    前面已学习了一种自定义控件的实现,是Andriod 自定义控件之音频条,还没学习的同学可以学习下,学习了的同学也要去温习下,一定要自己完全的掌握了,再继续学习,贪多嚼不烂可不是好的学习方法,我们争取学 ...

  2. Web Api 与 Andriod 接口对接开发经验

    最近一直急着在负责弄Asp.Net Web Api 与 Andriod 接口开发的对接工作! 刚听说要用Asp.Net Web Api去跟 Andriod 那端做接口对接工作,自己也是第一次接触Web ...

  3. Andriod小项目——在线音乐播放器

    转载自: http://blog.csdn.net/sunkes/article/details/51189189 Andriod小项目——在线音乐播放器 Android在线音乐播放器 从大一开始就已 ...

  4. Andriod学习笔记1:代码优化总结1

    多行变一行 比如说开发一个简单的计算器应用程序,需要定义0-9的数字按钮,第一次就习惯性地写出了如下代码: Button btn0; Button btn1; Button btn2; Button ...

  5. 20160113第一个ANDRIOD开发日志

    今天开发了第一个andriod程序,测试录音和播放功能.源码是网上抄来的. 代码: unit Unit2; interface uses   System.SysUtils, System.Types ...

  6. 0.[WP Developer体验Andriod开发]之从零安装配置Android Studio并编写第一个Android App

    0. 所需的安装文件 笔者做了几年WP,近来对Android有点兴趣,尝试一下Android开发,废话不多说,直接进入主题,先安装开发环境,笔者的系统环境为windows8.1&x64. 安装 ...

  7. Andriod Studio adb.exe,start-server' failed -- run manually if necessary 解决

    首先查看了我的任务管理器,共有三个adb的程序在运行: 错误提示的是 Andriod Studio 中的adb.exe启动失败,于是,去关掉另外两个adb.exe,两分钟左右后,又出现了三个adb. ...

  8. [Andriod] - Andriod Studio + 逍遥模拟器

    Andriod Studio自身自带的模拟器实在太卡,用Genymotion模拟器又要安装VirtualBox,然后一堆的设置,结果还是卡B. 网上下了个逍遥模拟器,这模拟器是游戏专用的,目前正式版的 ...

  9. andriod studio

    初衷:使用andriod的webview调用html页面,生成app. AVD注意细节: RAM : 1G VM heap:228MB Graphics:software - GLES 2.0 存在的 ...

随机推荐

  1. 【数位dp入门】【HDU2089】62

    为了我的点歪的技能树…… 所以开始补一些sb的东西…… #include<bits/stdc++.h> typedef long long ll; using namespace std; ...

  2. 2017多校第9场 HDU 6166 Senior Pan 堆优化Dij

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6166 题意:给你一个有向图,然后给你k个点,求其中一个点到另一个点的距离的最小值. 解法:枚举二进制位 ...

  3. ado中dispose和close的区别,摘自网络

    Close() and Dispose() are basically the same thing on an ADO.NET connection object for providers shi ...

  4. php文件上传需要的配置

    服务端配置(php.ini) 1.file_uploads=On  //支持HTTP上传 2.upload_tmp_dir =”” //临时文件保存的目录 3.upload_max_filesize ...

  5. Restful Framework (三)

    目录 一.版本 二.解析器 三.序列化 四.请求数据验证 一.版本 回到顶部 程序也来越大时,可能通过版本不同做不同的处理 没用rest_framework之前,我们可以通过以下这样的方式去获取. c ...

  6. Path Sum I&&II

      I Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up ...

  7. javascript大神修炼记(3)——条件分支

    读者朋友们好,我们今天接着前面的讲,前面已经大概了讲了一下运算符,今天的任务主要就是讲解逻辑条件分支,循环. 我们先就来模拟一个逻辑块,就用我们经常接触到的买车票来说吧,车票的价格对不同的人价格是有差 ...

  8. 在LoadRunner中转换字符串大小写的C语言函数

    在LoadRunner中转换字符串大小写的C语言函数 . loadrunner语言ccharacterstringaction 封装ConvertToXXX函数: //ConvertToUpper f ...

  9. Jsonp方式和httpclient方式有什么区别?

    jsonp基于js,解决跨域问题,本质发起ajax情求但是Jsonp只支持get请求. 它不安全,它先解析js,然后发起ajax请求,然后获取到返回值,通过浏览器返回,最后解析. JQuery和Spr ...

  10. MS SQL Server迁移至Azure SQL(官方工具)

    前面,我有尝试过将MS SQL Server数据数据迁移至Azure SQL,请参考<MS SQL Server迁移至Azure SQL>,使用的是第三方工具,但现在官方更新了工具,我们尝 ...