2016-10-08 20 views

答えて

0

Googleの「Androidディープリンク」。あなたは、たとえば取得します:

this link

は、詳細や、あなたのディープリンクについては注意してください動作しません。あなたの活動は、「標準」ではないとインスタンスがすでに作成されている場合は、インテントを受け取る場合

@Override 
public void onCreate(Bundle savedInstanceState) { 
    super.onCreate(savedInstanceState); 
    setContentView(R.layout.main); 

    Intent intent = getIntent(); 
    String action = intent.getAction(); 
    Uri data = intent.getData(); 
} 

:あなたが意図から値を読み取るために必要な活動で

<activity 
    android:name="com.example.android.GizmosActivity" 
    android:label="@string/title_gizmos" > 
    <intent-filter android:label="@string/filter_title_viewgizmos"> 
     <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 "http://www.example.com/gizmos” --> 
     <data android:scheme="http" 
       android:host="www.example.com" 
       android:pathPrefix="/gizmos" /> 
     **<!-- note that the leading "/" is required for pathPrefix-->** 
     <!-- Accepts URIs that begin with "example://gizmos” --> 
     <data android:scheme="example" 
       android:host="gizmos" /> 

    </intent-filter> 
</activity> 

onNewIntent方法。

+0

tnx、アクティビティにコードを書く必要はありませんか? –

+0

はい、できます。ちょうどリンクに従ってください。私は答えに何かを加えます – kingston

関連する問題