自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(6)
  • 资源 (8)
  • 收藏
  • 关注

原创 Android中监听手机来电及状态

Android中对电话的管理类是:TelephonyManage。通过TelephonyManage,可以通过gteXXX()获得一系列的电话的状态信息,如SIM的相关信息等。具体的可以看下源码。Android中监听手机来电不是通过广播来实现的。在TelephonyManage中,有个listener方法:/** * Registers a liste

2015-10-29 19:56:55 1857

原创 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 722

原创 判断字符串中只包含字母和数字

判断字符串中只包含字母和数字在用户输入用户名后,要做一个关于用户名的合法判断:只包含字母和数字。一开始使用的是Character.isLetterOrDigit方法:private boolean isLetterOrNumber(String string) { boolean flag = false; for (int i = 0; i < string.length

2015-10-20 21:17:20 11647 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 2682 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 2902

原创 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 3808 2

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除