2017-12-12 25 views
0

私はアンドロイドアプリで働いています。私はwhatsapp共有機能を追加しました。私はそれを成功させました。ユーザーが共有しているリンクをクリックすると、アンドロイドアプリケーションの特定のアクティビティを開きたいと思います。リンクは運がない、私はsomebuddyがこれで私を助けることを願っています。リンクをクリックして特定のアクティビティを開くにはどうすればよいですか?

は、マニフェスト

<activity 
      android:name=".ProductDescriptionActivity" 
      android:exported="true" 
      android:screenOrientation="portrait" 
      android:theme="@style/Theme.AppCompat.NoActionBar"> 

      <intent-filter> 
       <action android:name="com.abc.allaboutcity.MESSAGE" /> 
       <category android:name="android.intent.category.DEFAULT" /> 
      </intent-filter> 


      <intent-filter android:autoVerify="true"> 
       <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="http://allaboutcity.in" 
        android:pathPrefix="/allaboutcity" /> 
      </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" /> 
       <!-- Accepts URIs that begin with "example://gizmos” --> 
       <data android:scheme="allaboutcity" 
        android:host="allaboutcity" /> 
      </intent-filter> 
     </activity> 
+0

マニフェストとセットに必要なインテントフィルタと、必要なスキームにあなたの活動を追加開きたいという活動にマニフェストファイル内のインテントフィルタを追加する必要がありますその中に! – Xenolion

+0

これをチェック:https://stackoverflow.com/questions/20791482/start-activity-intent-on-clicking-text-inside-webview –

+0

https://developer.android.com/studio/write/app -link-indexing.html –

答えて

0

を追加しましたあなたは

<activity 
    android:name="Your Activity" 
    android:label="Your Activity Title" 
    android:theme="Your Style"> 
    <intent-filter> 
     <action android:name="android.intent.action.MAIN" /> 
     <category android:name="android.intent.category.DEFAULT" /> 
    </intent-filter> 
    <intent-filter android:autoVerify="true"> 
     <action android:name="android.intent.action.VIEW" /> 
     <category android:name="android.intent.category.DEFAULT" /> 
     <category android:name="android.intent.category.BROWSABLE" /> 
     <data 
      android:host="your url" 
      android:path="/your path" 
      android:scheme="http" /> 
    </intent-filter> 
</activity> 
+0

私はこれをどのように書くべきですか? –

+0

リンクをクリックしたときに開くアクティビティ –

+0

これを試してみてください。 –

関連する問題