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