摘要: intresourceId=R.drawabel.icon;Drawable d = getResources().getDrawable(resourceId); Bitmap bp = drawableToBitmap(d); bp = setGrey(bp);imageView.setImageBitmap(bp);//灰显---------------相关方法 /** * 将Drawable转化为Bitmap */ public static Bitmap drawableToBitmap(Drawable drawable) { ... 阅读全文
posted @ 2013-08-28 10:36 马骝 阅读(272) 评论(0) 推荐(0)
摘要: 方法1// 如果输入法在窗口上已经显示,则隐藏,反之则显示 InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); imm.toggleSoftInput(0, InputMethodManager.HIDE_NOT_ALWAYS);方法2 // 隐藏软键盘 InputMethodManager imm = (InputMethodManager) getSystemService(Context.... 阅读全文
posted @ 2013-08-15 10:06 马骝 阅读(275) 评论(0) 推荐(0)
摘要: *****集合合并去重 /** * list1中剔除和list2重复的部分,集合去从 */ private void deleteRepeat(List list1, List list2) { ArrayList temp = new ArrayList(); temp.addAll(list1); temp.retainAll(list2); list1.removeAll(temp); } 阅读全文
posted @ 2013-07-18 10:48 马骝 阅读(114) 评论(0) 推荐(0)
摘要: Linearlayout ll = (LinearLayout) findViewById(R.id.navi_ll);//该layout包裹了三个imageview。ImageView[] imgviews =new ImageView[3]//Imageview imgviews[i] = (ImageView) ll.getChildAt(i); 阅读全文
posted @ 2013-07-18 10:45 马骝 阅读(231) 评论(0) 推荐(0)
摘要: ********系统字符调用方法 布局 android:text="@android:string/cancel"/>代码 android.R.string.cancel 阅读全文
posted @ 2013-07-18 10:44 马骝 阅读(179) 评论(0) 推荐(0)
摘要: /** 判断是否存在物理菜单键 */ protected boolean isExistMenuKey() { boolean isExist = false; Class viewConfiguration = null; try { viewConfiguration = Class.forName("android.view.ViewConfiguration"); } catch (ClassNotFoundException e) { Log.e(TAG, "", e); ... 阅读全文
posted @ 2013-07-18 10:40 马骝 阅读(619) 评论(0) 推荐(0)
摘要: /** * 获取系统字体大小 * * @return 1:正常 ;1.5:超大 */ public static float getFontSize() { Configuration mCurConfig = new Configuration(); try { mCurConfig.updateFrom(ActivityManagerNative.getDefault().getConfiguration()); } catch (RemoteException e) { ... 阅读全文
posted @ 2013-07-18 10:38 马骝 阅读(461) 评论(0) 推荐(0)
摘要: ******访问另一个应用“AboutActivity”的界面注意 不在同一个进程时,隐式intent不可用。App1 App2:方位App1的某个界面 Intent intent = new Intent(); intent.setClassName("c... 阅读全文
posted @ 2013-07-18 10:36 马骝 阅读(215) 评论(0) 推荐(0)
摘要: 多国通用public static String getAndroidTimeFormat(Context context, Long time) { int flags = DateUtils.FORMAT_SHOW_DATE | DateUtils.FORMAT_NUMERIC_DATE | DateUtils.FORMAT_SHOW_TIME; String dateStr = DateUtils.formatDateTime(context, time, flags); return dateStr; } 阅读全文
posted @ 2013-07-18 10:34 马骝 阅读(393) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2013-07-17 10:59 马骝 阅读(548) 评论(0) 推荐(0)