- 博客(6)
- 资源 (8)
- 收藏
- 关注
原创 Android中监听手机来电及状态
Android中对电话的管理类是:TelephonyManage。通过TelephonyManage,可以通过gteXXX()获得一系列的电话的状态信息,如SIM的相关信息等。具体的可以看下源码。Android中监听手机来电不是通过广播来实现的。在TelephonyManage中,有个listener方法:/** * Registers a liste
2015-10-29 19:56:55 1861
原创 TextWatcher:监听编辑框EditText中内容的改变
用来监听编辑框EditText中内容的改变。源码:/** * When an object of a type is attached to an Editable, its methods will * be called when the text is changed. */public interface TextWatcher extends NoCo
2015-10-23 19:44:50 725
原创 判断字符串中只包含字母和数字
判断字符串中只包含字母和数字在用户输入用户名后,要做一个关于用户名的合法判断:只包含字母和数字。一开始使用的是Character.isLetterOrDigit方法:private boolean isLetterOrNumber(String string) { boolean flag = false; for (int i = 0; i < string.length
2015-10-20 21:17:20 11682 2
原创 退出Dialog时,Activity的生命周期运行情况
之前有把Activity的Theme设置成Dialog,这样Activity显示成Dialog,本质还是Activity。拥有Activity的生命周期函数和特性。android:theme="@android:style/Theme.Dialog"在Activity A中启动这样的Dialog B,这时Activity A会运行onPause,退出Dialog B时,Activity
2015-10-16 20:25:19 2694 2
原创 Activity中setContentView方法调用过程
在Activity的OnCreate中,会调用setContentView来显示布局:protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.xxx); }在Activity中,setC
2015-10-15 19:53:57 2912
原创 android:hint 默认提示内容
android:hint="@string/xxx" setHint(int)对应的是:在输入框输入之前(为空)时,默认显示的提示信息。<EditText android:id="@+id/connect_value" android:layout_width="match_parent" android:layout_height="w
2015-10-12 14:23:01 3834 2
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人