Bagikan melalui


Intent.UriAndroidAppScheme Bidang

Definisi

Perhatian

This constant will be removed in the future version. Use Android.Content.IntentUriType enum directly instead of this field.

Bendera untuk digunakan dengan #toUri dan #parseUri: string URI selalu memiliki skema "android-app:".

[Android.Runtime.Register("URI_ANDROID_APP_SCHEME", ApiSince=22)]
[System.Obsolete("This constant will be removed in the future version. Use Android.Content.IntentUriType enum directly instead of this field.", true)]
public const Android.Content.IntentUriType UriAndroidAppScheme = 2;
[<Android.Runtime.Register("URI_ANDROID_APP_SCHEME", ApiSince=22)>]
[<System.Obsolete("This constant will be removed in the future version. Use Android.Content.IntentUriType enum directly instead of this field.", true)>]
val mutable UriAndroidAppScheme : Android.Content.IntentUriType

Nilai Bidang

Value = 2

Penerapan

Atribut

Keterangan

Bendera untuk digunakan dengan #toUri dan #parseUri: string URI selalu memiliki skema "android-app:". Ini adalah variasi yang #URI_INTENT_SCHEME formatnya lebih sederhana untuk kasus URI http/https yang dikirimkan ke nama paket tertentu. Formatnya adalah:

android-app://{package_id}[/{scheme}[/{host}[/{path}]]][#Intent;{...}]

Dalam skema ini, hanya yang package_id diperlukan. Jika Anda menyertakan host, Anda juga harus menyertakan skema; termasuk jalur juga memerlukan host dan skema. #Intent akhir; fragmen dapat digunakan tanpa skema, host, atau jalur. Perhatikan bahwa ini tidak dapat digunakan dengan niat yang memiliki #setSelector, karena niat dasar akan selalu memiliki nama paket eksplisit.

Beberapa contoh bagaimana skema ini dipetakan ke objek Niat:

<table border="2" width="85%" align="center" frame="hsides" rules="rows"><colgroup align="left" /<>colgroup align="left" /><thead><tr><th>URI</th th<>>Intent</th></tr></thead>

<tbody><tr><td>android-app://com.example.app</td td><><table style="margin:0; border:0; cellpadding:0; cellpacing:0">tr><td>Action: </td><td#ACTION_MAIN<>/td></tr<>tr><td>Package: </td><tdcom.example.app></td></tr<>/table></td<>/tr><<>td><><android-app://com.example.app/http/example.com>< table style="margin:0;< border:0; cellpadding:0; cellpacing:0">tr><td>Action: </td><td#ACTION_VIEW<>/td></tr tr<><>td>Data: </td><td<>http://example.com//td></tr><td><>Package: </td><td/td>com.example.app<></tr></table></td<>/tr<>><tdandroid-app://com.example.app/http/example.com/foo?1234<>/td>><<table style="margin:0;< border:0; cellpadding:0; cellpacing:0">tr><td>Action: </td><td#ACTION_VIEW<>/td></tr tr<><>td>Data: </td><td<>http://example.com/foo?1234/td></tr><td><>Package: </td><td/td>com.example.app<></tr></table></td<>/tr<>><tdandroid-app://com.example.app/<br />#Intent;action=com.example.MY_ACTION;end<>/td>><<table style="margin:0;< border:0; cellpadding:0; cellpacing:0">tr><td>Action: </td><tdcom.example.MY_ACTION<>/td></tr<>tr><td>Package: </td><tdcom.example.app></td></tr<>/table></td<>/tr><<>td><><android-app://com.example.app/http/example.com/foo?1234<br />#Intent;action=com.example.MY_ACTION;end>< table style="margin:0;< border:0; cellpadding:0; cellspacing:0">tr><td>Action: </td><tdcom.example.MY_ACTION<>/td></tr tr><><td>Data: </td><td><http://example.com/foo?1234/td></tr<>tr><td>Package: </td><td/tdcom.example.app><<><>/table></td<>/tr<><>td<android-app://com.example.app/<br />#Intent;action=com.example.MY_ACTION;<br />i.some_int=100;S.some_str=hello;end>/td><><table border="" style="margin:0" ><<tr><td>Action: </td><td>com.example.MY_ACTION</td></tr tr><><td>Package: </td><td><com.example.app/td></tr tr><<>td>Extras: </td><td><some_int=(int)100<br />some_str=(String)hello/td></tr></table></td></tr></tbody></table>

Dokumentasi Java untuk android.content.Intent.URI_ANDROID_APP_SCHEME.

Bagian halaman ini adalah modifikasi berdasarkan pekerjaan yang dibuat dan dibagikan oleh Proyek Sumber Terbuka Android dan digunakan sesuai dengan istilah yang dijelaskan dalam Lisensi Atribusi Creative Commons 2.5.

Berlaku untuk