admin管理员组

文章数量:1516870

项目开发中有时需要安装没有应用图标的应用,以下提供2中方法供参考使用:

第一种方式,在启动页的activity中添加schema,因为我们把app的入口Activity申明为由接收隐士的Intent来启动,这样自然也就不会显示图标了

 <activity
            android:name="net.dd.daemon.MainActivity"
            android:theme="@style/OnePixelActivity"
            android:launchMode="singleInstance">
            
              <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
                <!--此处定义的schema供从外部调用-->
                <data
                    android:host="net.dd.daemon"
                    android:path="/keep"
                    android:scheme="daemon"/>
            </intent-filter>
 </activity>
启动方式:
 Uri uri = Uri.parse("daemon://net.dd.daemon/keep");
 Intent intent = new Intent(Intent.ACTION_VIEW, uri);
 context.startActivity(intent);

第二种方式,注释掉LAUNCHER

 <activity
  

本文标签: 用图标消神操作让你的应