ITeye博客

dialog

共 14 篇文章

关于tableactivity 中activitygroup 使用spinner 控件报错

这个就和显示dialog一样的道理,都要使用父类显示: 解决方法如下: 1 这是这个activity要显示的 view R.layout.localview中有spinner 控件 View contentView = LayoutInflater.from(this.getParent()).inflate(R.layout.localview,null); setContentView(contentView);

2012-01-14 11:05 · android 控件 · activity · dialog

创建Dialog

Android学习笔记--创建Dialog 1.分类 (1)AlertDialog.它能够管理0个`1个`2个`3个按钮和一个包含radio或者checkbox的可选项列表. (2)ProgressDialog.一个用于显示进度圈或者进度条的dialog,继承自AlertDialog,所以它也支持按钮. (3)DatePickerDialog.用于让用户选择日期的dialog. (4)TimePickerDialog.用于让用户选择时间的dialog. 如果你需要定义自己的dialog,只需要继承dialog或者上面提到四个组件之一, 并且为新的dialog定义自己的布局就可以了. 2.显示…

2011-07-12 09:37 · dialog

自定义dialog样式 简单填充

在做项目时要用dialog,dialog不想用alertdialog这个类,想用设计好的dialog样式。 这里我用到Dialog类,没有用alertdialog这个类。 在style .xml中 <style name="dialog" parent="@android:style/Theme.Dialog"> <item name="android:windowFrame">@null</item> <item name="android:windowIsFloating">true</item> <item name="android:windowIsTranslucent">true…

2011-07-11 15:13 · dialog

调用progressbar 的方法:

使用和取消时调用下面的两个方法 private ProgressDialog pBar; private void showWaitingDialog() { pBar = new ProgressDialog(this); pBar.setTitle("Title"); pBar.setMessage("请稍等..."); pBar.setProgressStyle(ProgressDialog.STYLE_SPINNER); pBar.show(); } private void cancelDialog() { if (pBar != null && pBar.isShowing())…

2011-06-27 13:55 · dialog

alertdialog——setview 的 自定义view

我在做一个alertdialog时出错,关于自定义view, 下面是正确的调用代码,onCreateDialog方法中: [align=left] LayoutInflater inflater2 =LayoutInflater.from(this); //dialog_set_merge是一个RadioGroup ,含有两个选项 View merge_view = inflater2.inflate(R.layout.dialog_set_merge,null); RadioGroup radioGroup_merge =[b] (RadioGroup) merge_view[/b].fi…

2011-06-23 17:32 · dialog · thread

dialog —— 不再显示

要显示一个dialog,要实现点击dialog上“不再提示”按钮之后,下次启动程序就不会出现此对话框,怎么实现呢: 1下面是一个例子: 主Activity: package hao.test.mima; import android.app.Activity; import android.app.AlertDialog; import android.app.Dialog; import android.content.DialogInterface; import android.os.Bundle; import android.view.KeyEvent; import hao.te…

2011-06-21 11:34 · dialog · C · C++ · OS · C# · Android

dialog 2(一步建立对话框,全)

new AlertDialog.Builder(YyBackUp.this) .setOnKeyListener(new DialogInterface.OnKeyListener() { @Override public boolean onKey(DialogInterface dialog, int keyCode, KeyEvent event) { // TODO Auto-generated method stub if (event.getKeyCode() == KeyEvent.KEYCODE_SEARCH) { return true; } return false; }…

2011-06-17 16:56 · dialog

Android设置横屏显示

android:screenOrientation="landscape" <activity android:name=".Test" android:label="@string/app_name" android:screenOrientation="landscape">

2011-06-17 14:09 · dialog · Android

android ProgressDialog 延迟几秒再消失

显示一个ProgressDialog,然后在线程中取消 final ProgressDialog dialog = ProgressDialog.show(this, "", "下载数据,请稍等 …", true, true); Thread t = new Thread(new Runnable() { @Override public void run() { try { Thread.sleep(10000);//让他显示10秒后,取消ProgressDialog } catch (InterruptedException e) { // TODO Auto-generated cat…

2011-06-16 14:23 · dialog · Android · thread

如何让不让AlertDialog dismissed by google search

google search 键可以导致dialog dismiss,虽然大多real device没有这个键,但还是预防为好。 .setOnKeyListener(new DialogInterface.OnKeyListener() { @Override public boolean onKey(DialogInterface dialog, int keyCode, KeyEvent event) { // TODO Auto-generated method stub if(event.getKeyCode() == KeyEvent.KEYCODE_SEARCH){ return …

2011-06-13 14:21 · dialog · Google · Blog · .net

打开程序在activity上出现一个AlertDialog

只要把 showDialog(0); 写在oncreat里,这样打开应用就会加载。 public class Test extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); showDialog(0); Button button1 = (Button) fi…

2011-06-08 17:18 · dialog

AlertDialog之2 onCreateDialog

重写: @Override protected Dialog onCreateDialog(int id) { switch (id) { case 0: { Dialog dialog = new AlertDialog.Builder(Test.this).setTitle("Question") .setMessage("Are you sure that you want to quit?") // 设置内容 // .setView(input)//这个view显示在message下面 .setPositiveButton("Yes", // 设置确定按钮 new DialogInt…

2011-06-08 17:11 · dialog

AlertDialog

new AlertDialog.Builder(Test.this) .setTitle("Question") .setMessage("Are you sure that you want to quit?") .setPositiveButton("Yes", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { setResult(RESULT_OK); finish(); } }) .setNegativeButton("No", …

2011-06-08 16:45 · dialog

menuDialog

menuDialog = new AlertDialog.Builder(this).create(); WindowManager.LayoutParams lp = menuDialog.getWindow().getAttributes(); lp.alpha = 0.9f; //设置了对话框的透明度 lp.dimAmount = 0.5f; lp.y = 35; //对话框的显示位置 menuDialog.getWindow().setAttributes(lp)

2011-05-20 17:29 · dialog