Android-隐藏app图标以及隐式启动


隐藏APP桌面图标

<activity android:name=".LaunchActivity">
     <intent-filter>
           <action android:name="android.intent.action.MAIN" />
           <data android:host="LaunchActivity" android:scheme="com.tuobang.xsfx" tools:ignore="AppLinkUrlError"/>
           <category android:name="android.intent.category.LAUNCHER" />
     </intent-filter>
</activity>
  • 在manifest的入口activity里面intent-filter中设置 元素。
    注:必须添加tools:ignore="AppLinkUrlError" ,否则会出错,host值为自定义,scheme值为包名

  • dada配置参考:http://www.cnblogs.com/shenhao/p/5947284.html

通过另一个APP隐式启动

Intent intent = new Intent();
ComponentName cn = new ComponentName("com.tuobang.xsfx", "com.tuobang.xsfx.LaunchActivity");
intent.setComponent(cn);
Uri uri = Uri.parse("com.tuobang.xsfx.LaunchActivity");
intent.setData(uri);
startActivity(intent);


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM