随笔分类 -  Android

判断软键盘是不是可见
摘要: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 邹创 阅读(216) 评论(0) 推荐(0)

android 设置Dialog的宽度
摘要: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 邹创 阅读(1005) 评论(0) 推荐(0)

Android到market上查看某应用程序 10 }
摘要: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 邹创 阅读(230) 评论(0) 推荐(0)

android发邮件
摘要:启动一个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 邹创 阅读(219) 评论(0) 推荐(0)

导航