2015-04-06 5 views
7

Wenn ich <data android:scheme="http" /> in AndroidManifest.xml hinzufügen, verursacht es meine App nicht mehr im Launcher aufgeführt werden. Warum?App nicht in Launcher aufgrund <Daten android: scheme = "http" /> in AndroidManifest.xml

AndroidManifest.xml ohne <data android:scheme="http" />:

<?xml version="1.0" encoding="utf-8"?> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
    package="com.ebookfrenzy.mywebview" > 
    <uses-permission android:name="android.permission.INTERNET" /> 
    <application 
     android:allowBackup="true" 
     android:icon="@drawable/ic_launcher" 
     android:label="@string/app_name" 
     android:theme="@style/AppTheme" > 
     <activity 
      android:name=".MyWebViewActivity" 
      android:label="@string/app_name" > 
      <intent-filter> 
       <action android:name="android.intent.action.MAIN" /> 
       <category android:name="android.intent.category.LAUNCHER" /> 
      </intent-filter> 
     </activity> 
    </application> 
</manifest> 

AndroidManifest.xml mit <data android:scheme="http" />:

<?xml version="1.0" encoding="utf-8"?> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
    package="com.ebookfrenzy.mywebview" > 
    <uses-permission android:name="android.permission.INTERNET" /> 
    <application 
     android:allowBackup="true" 
     android:icon="@drawable/ic_launcher" 
     android:label="@string/app_name" 
     android:theme="@style/AppTheme" > 
     <activity 
      android:name=".MyWebViewActivity" 
      android:label="@string/app_name" > 
      <intent-filter> 
       <action android:name="android.intent.action.MAIN" /> 
       <category android:name="android.intent.category.LAUNCHER" /> 
       <data android:scheme="http" /> 
      </intent-filter> 
     </activity> 
    </application> 
</manifest> 

Antwort

17

Aufgrund der Intent-Filter Anpassung/Auflösung Prozess, wenn Android "zeigt die Anwendungen" im Launcher , es zeigt die Liste mit Matching-Mechanismus, und wenn Sie Ihre App hinzufügen passt nicht, weil das System nicht br Wenn Sie den Launcher anzeigen, werden alle Daten angezeigt.

Die Lösung ist ein weiteres Intent-Filter erstellen, zum Beispiel:

<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
    package="com.ebookfrenzy.mywebview" > 
    <uses-permission android:name="android.permission.INTERNET" /> 
    <application 
     android:allowBackup="true" 
     android:icon="@drawable/ic_launcher" 
     android:label="@string/app_name" 
     android:theme="@style/AppTheme" > 
     <activity 
      android:name=".MyWebViewActivity" 
      android:label="@string/app_name" > 
      <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" /> 
       <data android:scheme="http" /> 
      </intent-filter> 
     </activity> 
    </application> 
</manifest> 
+0

half mir bei meinem Problem - Dank und gestimmt! –

2
  //Add this to your Activity 
      <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="@string/app_name" /> 
      </intent-filter> 
Verwandte Themen