2013年8月6日

摘要: Give your activity's root view a known ID, say '@+id/activityRoot', hook a GlobalLayoutListener into the ViewTreeObserver, and from there calculate the size diff between your activity's view root and the window size:final View activityRootView = findViewById(R.id.activityRoot);activi 阅读全文
posted @ 2013-08-06 18:02 邹创 阅读(215) 评论(0) 推荐(0)

2013年6月25日

摘要: 1 private void setWinWidth() {2 DisplayMetrics metric = new DisplayMetrics();3 getWindowManager().getDefaultDisplay().getMetrics(metric);4 LayoutParams p = getWindow().getAttributes();5 p.width = (int) (metric.widthPixels * 0.8);6 getWindow().setAttributes... 阅读全文
posted @ 2013-06-25 09:58 邹创 阅读(1002) 评论(0) 推荐(0)

2013年6月20日

摘要: 1 private void goToMarket(String packageName) { 2 try { 3 Intent intent = new Intent(Intent.ACTION_VIEW); 4 intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 5 intent.setData(Uri.parse("market://details?id=" + packageName)); 6 startActivity(... 阅读全文
posted @ 2013-06-20 16:34 邹创 阅读(227) 评论(0) 推荐(0)
摘要: 启动一个Intent发邮件,指定receiver email, subject, body: 1 /** 2 * Start an activity to send an email to the given receiver, with the given subject and text body. 3 * @param receiver The receiver's email address 4 * @param subject Email subject. 5 * @param text Email body. 6 */ 7 ... 阅读全文
posted @ 2013-06-20 16:13 邹创 阅读(214) 评论(0) 推荐(0)

2013年4月22日

摘要: Boolean值:True, False参数个数:len(sys.argv)for 循环://range(5) 产生0~4的序列[0, 1, 2, 3, 4], range(1, 5)——[1, 2, 3, 4]1 for i in range(10): 2 pass列出目录dir下的所有子文件和子在文件夹:os.listdir(dir)字符串查找:str1.find(str2)获得当前工作目录:os.getcwd()命令行参数个数:len(sys.argv)遍历命令行参数:1 for i in range(1, len(sys.argv)): 2 print "参数",. 阅读全文
posted @ 2013-04-22 16:23 邹创 阅读(124) 评论(0) 推荐(0)

2013年4月19日

摘要: 1. 当ListView的item里面有Button之类的可点击控件时,ListView的Item无法点击。Solution:给item里面的Button之类的可点击控件加上android:focusable="false"2. Drawable转化为bitmap: public static Bitmap drawableToBitmap (Drawable drawable) { if (drawable instanceof BitmapDrawable) { return ((BitmapDrawable)drawable).getBitmap(); }... 阅读全文
posted @ 2013-04-19 18:45 邹创 阅读(152) 评论(0) 推荐(0)

导航