1、在activity android:name=".Uninstaller" android:label="@string/app_name" android:windowSoftInputMode="adjustPan",加入了android:windowSoftInputMode="adjustPan",就不会自动弹出软键盘了。
--------该方法可以把键盘隐藏掉,但界面不能滚动,即使布局中用了scrolllayout.
2、就是将焦点转移到别的组件上,如转移到Button上
button.setFocusable(true);
button.setFocusableInTouchMode(true);
button.requestFocus();
button.requestFocusFromTouch();
-------此方法靠谱。
3、EditText.clearFocus -------这方法根本不行。

AlertDialog自定义视图中的按钮,当点击时,想把AlertDialog隐藏掉,发现不可以,只能通过AlertDialog自带的三个按钮,将其消失掉。

//带取消按钮的ProgressDialog
downloadDialog = new ProgressDialog(context);
downloadDialog.setCancelable(false);//back键不起作用,若为true,按back键,则ProgressDialog消失掉
downloadDialog.setMessage("正在下载安装包...");
downloadDialog.setButton("取消", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int i) {
dialog.cancel();
downApkCancel = true;
}
});

更多相关文章

  1. Android退出程序的多种方法
  2. android 超简单的拖动按钮 悬浮按钮 吸附按钮
  3. Android数据共享 sharedPreferences 的使用方法
  4. Android Studio使用过程中遇到的问题(一)-- "value 2"异常解决方法
  5. Android Studio 新建编辑条 点击按钮显示控件中的内容
  6. android 关闭弹出键盘
  7. 简单总结RectF、Rect 和Matrix ,还有Paint的使用方法
  8. 关于用Android的API重写drawRegion方法的代码

随机推荐

  1. 开源一个友盟 for android 操作的封装包
  2. android SeekBar自定义样式滑动条的使用
  3. Android之短信接收
  4. Android(安卓)拨打电话 对方接听时震动功
  5. android 4.2 源码在64位Ubuntu编译
  6. android布局中容易混淆的几个属性
  7. Android学习一:Hello World
  8. 《Android第一行代码》first reading 十
  9. android aidl iBinder理解
  10. [置顶] Android之ContextMenu的使用方法