2015-04-06 19 views
7

AndroidManifest.xml içinde <data android:scheme="http" /> eklediğimde, uygulamanın artık başlatıcıda listelenmemesine neden oluyor. Niye ya?App AndroidManifest.xml içinde <data android: scheme = "http" /> nedeniyle başlatıcıda listelenmemiş

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

<?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<data android:scheme="http" /> ile: nedeniyle Android Başlatıcıda "uygulamalarını gösterir" niyet filtre eşleştirme/çözünürlük süreci için

<?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> 

cevap

17

Bu, eşleşen mekanizmayı kullanarak listeyi gösterir ve uygulamanızı eklediğinizde, eşleşmez, çünkü sistem br değil başlatıcıyı görüntülediğinde herhangi bir veri girme.

çözüm örneğin, başka niyet-filtre oluşturmak geçerli:

<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

benim konuda bana yardım etti - teşekkürler ve oy! –

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> 
İlgili konular