<?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. 0x3F3F3F3F——ACM中的无穷大常量

    在算法竞赛中,我们常常需要用到设置一个常量用来代表“无穷大”. 比如对于int类型的数,有的人会采用INT_MAX,即0x7fffffff作为无穷大.但是以INT_MAX为无穷大常常面临一个问题,即加 ...

  2. FineReport——JS二次开发(局部刷新)

    在FR中,可以通过在form表单设置多个报表模板,然后通过对某一模板刷新实现局部刷新的功能,在cpt模板中,由于只存在一个模板,所以无法实现局部刷新. 其实,最好的局部刷新办法是自定义一个页面,然后添 ...

  3. 海量文件查重SimHash和Minhash

    SimHash 事实上,传统比较两个文本相似性的方法,大多是将文本分词之后,转化为特征向量距离的度量,比如常见的欧氏距离.海明距离或者余弦角度等等.两两比较固然能很好地适应,但这种方法的一个最大的缺点 ...

  4. thinkphp5 消息队列thinkphp-queue扩展

    1.简介 thinkphp-queue是thinkphp的一个第三方扩展, 内置了 Redis,Database,Topthink ,Sync这四种驱动,推荐使用redis 2. 下载 和安装 com ...

  5. ConcurrentHashMap的使用

    http://blog.csdn.net/gjt19910817/article/details/47353909 Long oldValue, newValue; while(true) { old ...

  6. Django 定制验证码

    一.图片验证码 方式一: def get_validCode_img(request): path=os.path.join(settings.BASE_DIR,'static','image','1 ...

  7. LeetCode解题报告—— Swap Nodes in Pairs & Divide Two Integers & Next Permutation

    1. Swap Nodes in Pairs Given a linked list, swap every two adjacent nodes and return its head. For e ...

  8. NYOJ 116 士兵杀敌二

    士兵杀敌(二) 时间限制:1000 ms  |  内存限制:65535 KB 难度:5   描述 南将军手下有N个士兵,分别编号1到N,这些士兵的杀敌数都是已知的. 小工是南将军手下的军师,南将军经常 ...

  9. hdu 3308(线段树区间合并)

    LCIS Time Limit: 6000/2000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submis ...

  10. Subsets I&&II——经典题

    Subsets I Given a set of distinct integers, nums, return all possible subsets. Note: Elements in a s ...