且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Android找不到应用程序的主要活动

更新时间:2023-01-25 21:02:34

只需弄清楚:

问题出在mainActivity标记内.您需要使用<分隔MainActivity的内部内容.intent-filter>标签.

The problem was within the mainActivity tag. You need to separate the inner content of your MainActivity with an < intent-filter> tag.

之前:

  <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.LAUNCHER" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />  
        <data android:scheme="http"
              android:host="my.website.for.DeepLink"
              android:pathPrefix="/#/register_login/status=successful" />          
    </intent-filter>       

(工作中的)之后:

   <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
   </intent-filter>
   <intent-filter>
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />  
        <data android:scheme="http"
              android:host="my.website.for.DeepLink"
              android:pathPrefix="/#/register_login/status=successful" />          
    </intent-filter>       

更多信息: https://developer.android.com/guide/components/intents-filters.html#imatch