- 博客(7)
- 资源 (2)
- 收藏
- 关注
原创 androd中显示listview的dialog,并实现listview的点击事件
private void setListviewDialog() { //自定义一个布局文件 LinearLayout linearLayoutMain = new LinearLayout(this); linearLayoutMain.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT
2016-04-14 13:48:56 1670
原创 android中对输入手机号码有效性验证(是否为正确的手机号码)
在Utils包名下面创建电话号码匹配工具类public class TelNumMatch { /* * 10. * 移动: 2G号段(GSM网络)有139,138,137,136,135,134,159,158,152,151,150, 11. * * 3G号段(TD-SCDMA网络)有157,182,183,188,187,181 147是移动TD上网卡专用号段. 联
2016-04-10 12:59:52 8465
原创 android中listview紧接着Button按钮,发现最后一条item没有下横线??
说明:像这种Listview后面还有控件的,整体布局最好用FrameLayout,如果用LinearLayout的话,如果Listview的height用android:layout_height="match_parent",后面的控件布局不上来;如果Listview的height用android:layout_height="wrap_content",最后一条item会没有下横线。1.布局效果
2016-04-10 12:45:51 881
原创 Android动态设置字体颜色
1.在values文件夹里面创建colors.xml文件,然后写入相应的颜色<!-- 白色 --> <color name="white">#FFFFFF</color>2.然后在代码里面动态设置mSubmit.setTextColor(getResources().getColor(R.color.white)); 备注:有些人很可能写成这样,如下:mSubmit.setTextColor(R.
2016-04-08 11:38:27 823 1
原创 android中listview最后一个item没有下横线的原因?
错误的布局代码 <ListView android:id="@+id/activity_my_controller_listview" android:layout_width="wrap_content" android:layout_height="wrap_content" > </ListView>正确地布局代码 <ListVie
2016-04-07 18:46:23 2664
原创 把byte[]转换为String
/* * 此方法将蓝牙通讯返回的字节转换为字符串 */ public static String bytesToString(byte[] bytes) { StringBuilder stringBuilder = new StringBuilder(bytes.length); for (byte byteChar : bytes)
2016-04-06 10:00:25 2162
原创 android系统自带的振动器以及倒计时器
1.系统自带的振动器private Vibrator mVibrator;...// 使用系统服务检索振动器mVibrator = (Vibrator) mContext.getSystemService(Context.VIBRATOR_SERVICE);...mVibrator.vibrate(200);// 振动0.2秒1.系统自带的倒计时器写CountDownTimerUtil,
2016-04-06 09:38:19 1043
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人