11 2014 档案

摘要:View vFocus=getWindow().getDecorView().findFocus(); if(vFocus instanceof EditText){ ((EditText) vFocus).setText("当前焦点");} 阅读全文

posted @ 2014-11-28 15:55 屌丝迷途 阅读(926) 评论(0) 推荐(0)

摘要:1 public void openApp(String packageName, Context context) { 2 PackageManager packageManager = context.getPackageManager(); 3 Int... 阅读全文

posted @ 2014-11-21 14:54 屌丝迷途 阅读(1956) 评论(0) 推荐(0)

摘要:1 /** 2 * 安装apk 3 * 4 * @param url 5 */ 6 private void installApk() { 7 File apkfile = new File(apkFilePath); 8 ... 阅读全文

posted @ 2014-11-21 10:47 屌丝迷途 阅读(707) 评论(0) 推荐(0)

摘要:1 public static final int FLAG_HOMEKEY_DISPATCHED = 0x80000000; 2 3 @Override 4 protected void onCreate(Bundle savedInstanceState) { 5 s... 阅读全文

posted @ 2014-11-20 17:36 屌丝迷途 阅读(505) 评论(0) 推荐(0)

摘要:1 public class Main4Activity extends Activity { 2 3 private TextView tv1; 4 private Button button1; 5 private RelativeLayout rlMain... 阅读全文

posted @ 2014-11-18 10:49 屌丝迷途 阅读(1132) 评论(0) 推荐(0)

摘要:1 @Override 2 protected void onCreate(Bundle savedInstanceState) { 3 super.onCreate(savedInstanceState); 4 setContentView(R.layou... 阅读全文

posted @ 2014-11-14 14:10 屌丝迷途 阅读(541) 评论(0) 推荐(0)

摘要:1 /** 2 * 获取父控件的位置y-popwindow的高度 = 应该显示的y坐标. x这里设置为center 不刻意指定坐标 注意:控件坐标永远是 左上角坐标! 3 * 4 * @param parent 5 */ 6 public v... 阅读全文

posted @ 2014-11-11 10:31 屌丝迷途 阅读(606) 评论(0) 推荐(0)

摘要:PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE); boolean screen = pm.isScreenOn(); 阅读全文

posted @ 2014-11-06 14:13 屌丝迷途 阅读(723) 评论(0) 推荐(0)

摘要:1 Intent intent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE); 2 Uri uri = Uri.fromFile(new File("/sdcard/image.jpg")); 3 intent.setData(uri); 4... 阅读全文

posted @ 2014-11-05 14:05 屌丝迷途 阅读(327) 评论(0) 推荐(0)

导航