2014年7月4日

发送邮件字符转换

摘要: //將html轉為text public string HtmlToText(string strContent) { strContent = strContent.Replace("&amp", "&"); ... 阅读全文

posted @ 2014-07-04 14:54 strangeman 阅读(260) 评论(0) 推荐(0) 编辑

2014年6月5日

清理画布

摘要: Paint paint1 = new Paint();paint1.setXfermode(new PorterDuffXfermode(Mode.CLEAR));canvas.drawPaint(paint1);paint1.setXfermode(new PorterDuffXfermode(M... 阅读全文

posted @ 2014-06-05 11:37 strangeman 阅读(175) 评论(0) 推荐(0) 编辑

2014年6月1日

android取国家,语言,存储大小等

摘要: private static String newUUID() { return UUID.randomUUID().toString(); } private static String getLocaleCountry() { return java.util.Locale.ge... 阅读全文

posted @ 2014-06-01 16:48 strangeman 阅读(300) 评论(0) 推荐(0) 编辑

2014年5月30日

android屏幕亮度

摘要: /** * 获得当前屏幕亮度的模式 * SCREEN_BRIGHTNESS_MODE_AUTOMATIC=1 为自动调节屏幕亮度 * SCREEN_BRIGHTNESS_MODE_MANUAL=0 为手动调节屏幕亮度 */ private int getScreenMode()... 阅读全文

posted @ 2014-05-30 14:30 strangeman 阅读(224) 评论(0) 推荐(0) 编辑

暂且解决INSTALL_FAILED_SHARED_USER_INCOMPATIBLE错误

摘要: 有时候我们在APK安装时由于工程制定了UID,换过签名后可能出现类似 INSTALL_FAILED_SHARED_USER_INCOMPATIBLE 或 INSTALL_FAILED_UPDATE_INCOMPATIBLE 的错误,对于后者我们可以通过Logcat看到具体的比如说 has no si... 阅读全文

posted @ 2014-05-30 14:11 strangeman 阅读(1387) 评论(0) 推荐(0) 编辑

2014年5月22日

android屏蔽软键盘并且显示光标

摘要: if (android.os.Build.VERSION.SDK_INT cls = EditText.class; Method setShowSoftInputOnFocus; setShowSoftInputOnFo... 阅读全文

posted @ 2014-05-22 14:47 strangeman 阅读(387) 评论(0) 推荐(0) 编辑

2014年4月28日

设置和获取Android中各种音量

摘要: 通过程序获取android系统手机的铃声和音量。同样,设置铃声和音量的方法也很简单!AudioManager am = (AudioManager) getSystemService(Context.AUDIO_SERVICE);//通话音量 int max = am.getStreamMaxVol... 阅读全文

posted @ 2014-04-28 10:56 strangeman 阅读(675) 评论(0) 推荐(0) 编辑

自定义广播

摘要: mSDStateBrocast = new SDStateBrocast(); IntentFilter intentFilter2 = new IntentFilter(); intentFilter2.addAction(Intent.ACTION_MEDIA_MOU... 阅读全文

posted @ 2014-04-28 10:21 strangeman 阅读(221) 评论(0) 推荐(0) 编辑

发送广播

摘要: public void sendPlayStateBrocast() {if (mContext != null){Intent intent = new Intent(BROCAST_NAME);intent.putExtra(MusicPlayState.PLAY_STATE_NAME, mPl... 阅读全文

posted @ 2014-04-28 10:17 strangeman 阅读(121) 评论(0) 推荐(0) 编辑

2014年4月21日

android取高度

摘要: Rect rect = new Rect();getWindow().getDecorView().getWindowVisibleDisplayFrame(rect);int top = rect.top; //状态栏高度View view = getWindow().findViewById(W... 阅读全文

posted @ 2014-04-21 15:41 strangeman 阅读(161) 评论(0) 推荐(0) 编辑

导航