как мне открывать ссылки в моем веб-обозревателе, доступном другим приложениям?Как обмениваться ссылками с моим приложением?
Я попытался это, но он не перечисляет мое приложение anywhere-
TextView uri = (TextView) findViewById(R.id.urlField);
//if (Intent.ACTION_MAIN.equals(getIntent().getAction())) {
String intentUri = (new Intent("com.example.browsableintent.MY_ACTION"))
.toUri(Intent.URI_INTENT_SCHEME).toString();
uri.setText(intentUri);
Log.w("URLHandler", intentUri);
//} else {
Uri data = getIntent().getData();
if (data == null) {
uri.setText(" ");
} else {
uri.setText(getIntent().getData().toString());
}
//}
// Load URL from Browsable intent filter if there is a valid URL pasted
if (uri.length() > 0)
webView.loadUrl(url);
else
// dont load
манифеста
<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" />
<data android:scheme="https" />
</intent-filter>
Не мог бы вы изменить свой вопрос и копировать вставить всю деятельность и AndroidManifest файла? –