Launch

SDK sample---Home

 

  1. uses-permission
  2. <category android:name="android.intent.category.HOME"/>
  3. Note also the DEFAULT category supplied here: this is required for the Context.startActivity method to resolve your activity when its component name is not explicitly specified
  4. private static ArrayList<ApplicationInfo> mApplications;  
    private static LinkedList<ApplicationInfo> mFavorites;
    ArrayList和LinkedList区别
  5. BroadcastReceiver
    registerReceiver 参数
    Register a BroadcastReceiver to be run in the main activity thread. The receiver will be called with any broadcast Intent that matches filter, in the main application thread.
  6.  
  7. 防止重复进入
    private void loadApplications(boolean isLaunching) {
            if (isLaunching && mApplications != null) {
                return;
            }
  8. PackageManager
    PackageManager manager = getPackageManager();  
    Intent mainIntent = new Intent(Intent.ACTION_MAIN, null);
    mainIntent.addCategory(Intent.CATEGORY_LAUNCHER);
    final List<ResolveInfo> apps = manager.queryIntentActivities(mainIntent, 0);
    Collections.sort(apps, new ResolveInfo.DisplayNameComparator(manager));
  9.  应用程序里面要有一个CATEGORY_LAUNCHER的属性,在这里就很方便得将它们都查找出来。
  10. 自定义ApplicationInfo用来存放应用程序的信息。
  11. GridView 
    setAdapter 

  12. mShowApplications.setOnClickListener(new ShowApplications());

    private class ShowApplications implements View.OnClickListener {
    ...showApplications(true);...or...hideApplications();
    }
  13. 在XML中定义动画效果。 
  14. 声明周期:onNewIntent、onDestroy、onResume、onRestoreInstanceState...

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值