• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
 






♂小旭

 
 

Powered by 博客园
博客园 | 首页 | 新随笔 | 联系 | 订阅 订阅 | 管理
上一页 1 2 3 4 5 6 ··· 8 下一页

2013年11月27日

Android之EditText文本框监听事件
摘要: editText= (EditText)findViewById(R.id.text);editText.addTextChangedListener(textWatcher);private TextWatcher textWatcher = new TextWatcher() {@Overridepublic void onTextChanged(CharSequence s, int start, int before, int count) {// TODO Auto-generated method stub //doSearchMethod(); Log.e("111&q 阅读全文
posted @ 2013-11-27 19:01 ♂小旭 阅读(2159) 评论(0) 推荐(0)
 

2013年11月26日

Android流量统计TrafficStats类的使用
摘要: 对于Android流量统计来说在2.2版中新加入了TrafficStats类可以轻松获取,其实本身TrafficStats类也是读取Linux提供的文件对象系统类型的文本进行解析。android.net.TrafficStats类中,提供了多种静态方法,可以直接调用获取,返回类型均为 long型,如果返回等于-1代表 UNSUPPORTED 当前设备不支持统计。Java代码static long getMobileRxBytes() //获取通过Mobile连接收到的字节总数,不包含WiFistatic long getMobileRxPackets() //获取Mobile连接收到的数据包总 阅读全文
posted @ 2013-11-26 18:19 ♂小旭 阅读(458) 评论(0) 推荐(0)
 
Android通过包名获取应用UID
摘要: try { PackageManager pm = getPackageManager(); ApplicationInfo ai = pm.getApplicationInfo("com.gesoft.bit.lavendercloud", PackageManager.GET_ACTIVITIES); Log.d("!!", "!!" + ai.uid); } catch (NameNotFoundException e) { e.printStackTrace(); } 阅读全文
posted @ 2013-11-26 18:18 ♂小旭 阅读(5837) 评论(0) 推荐(0)
 
Android获取手机通讯记录
摘要: StringBuilder smsBuilder1 = new StringBuilder();String str = null;String strNumber,strName = ""; int type; long callTime; Date date; String time= ""; ContentResolver cr = getContentResolver(); final Cursor cursor = cr.query(CallLog.Calls.CONTENT_URI, new String[]{CallLog.Calls.NU 阅读全文
posted @ 2013-11-26 17:14 ♂小旭 阅读(268) 评论(0) 推荐(0)
 
Android string字符串中首行缩进
摘要: \u3000 阅读全文
posted @ 2013-11-26 16:25 ♂小旭 阅读(669) 评论(0) 推荐(0)
 
android开发——自定义弹窗(PopupWindow)
摘要: LayoutInflater inflater = LayoutInflater.from(this); // 引入窗口配置文件 View view = inflater.inflate(R.layout.statement, null); Button btn = (Button) view.findViewById(R.id.btn); btn.setOnClickListener(ClickListener); // 创建PopupWindow对象 并设置高度和宽度 pop = new PopupWindow(view, 1000, 700, false); // 需要设置一... 阅读全文
posted @ 2013-11-26 13:55 ♂小旭 阅读(723) 评论(0) 推荐(0)
 
Android TextView 显示不同颜色的字
摘要: Spanned text = Html.fromHtml("沈阳" + "小旭");textView.setText(text); 阅读全文
posted @ 2013-11-26 11:40 ♂小旭 阅读(251) 评论(0) 推荐(0)
 
获取Android手机中所有的短信
摘要: 转自:http://android.tgbus.com/Android/tutorial/201104/349808.shtmlpublic String getSmsInPhone() { final String SMS_URI_ALL = "content://sms/"; final String SMS_URI_INBOX = "content://sms/inbox"; final String SMS_URI_SEND = "content://sms/sent"; final String SMS_URI_DRAFT 阅读全文
posted @ 2013-11-26 09:55 ♂小旭 阅读(963) 评论(0) 推荐(0)
 

2013年11月25日

Android TextView属性大全
摘要: android:ems 设置TextView的宽度为N个字符的宽度。 android:maxems 设置TextView的宽度为最长为N个字符的宽度。与ems同时使用时覆盖ems选项。android:maxLength 限制输入字符数。如设置为5,那么仅可以输入5个汉字/数字/英文字母。 android:lines 设置文本的行数,设置两行就显示两行,即使第二行没有数据。 android:maxLines 设置文本的最大显示行数,与width或者layout_width结合使用,超出部分自动换行,超出行数将不显示。 android:minLines 设置文本的最小行数,与lines类似。 an 阅读全文
posted @ 2013-11-25 10:26 ♂小旭 阅读(229) 评论(0) 推荐(0)
 

2013年11月23日

Android自定义控件
摘要: 第一步:定义一个有图片和文本的布局: 第二步:定义一个与这个布局对应的类:publicclass ImgTextBtnH extends LinearLayout { privatestaticfinal String TAG = ImgTextBtnH.class.getSimpleName(); private ImageView mImg; private TextView mTV; private Button mBtn; private Context mContext = null; public ImgTextBtnH(Context context) ... 阅读全文
posted @ 2013-11-23 10:53 ♂小旭 阅读(401) 评论(0) 推荐(0)
 
上一页 1 2 3 4 5 6 ··· 8 下一页