如何在android webview中处理特定Url?
我想在我的应用程序中打开自定义webview中的链接“”。当我启动包含此Web视图的新活动时,我将面对以下页面: 当我点击“加入对话”按钮时,我突然发现页面未找到,如下所示: 当我在互联网上搜索时,我发现我应该使用以下方法处理AndroidManifest.xml中的带有意图过滤器的Url:如何在android webview中处理特定Url?,android,android-studio,webview,android-webview,intentfilter,Android,Android Studio,Webview,Android Webview,Intentfilter,我想在我的应用程序中打开自定义webview中的链接“”。当我启动包含此Web视图的新活动时,我将面对以下页面: 当我点击“加入对话”按钮时,我突然发现页面未找到,如下所示: 当我在互联网上搜索时,我发现我应该使用以下方法处理AndroidManifest.xml中的带有意图过滤器的Url: <activity android:name=".MainSegment.Team.Team_Profile.Chatroom.VideoChatroomActivity">
<activity android:name=".MainSegment.Team.Team_Profile.Chatroom.VideoChatroomActivity">
<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="https"
android:host="appear.in"/>
</intent-filter>
</activity>
}
请帮我解决,提前谢谢 如果你点击“加入对话”按钮会发生什么?@TranHieu第二张图片出现在我的问题中!“网页不可用”
public class VideoChatroomActivity extends AppCompatActivity implements AdvancedWebView.Listener{
private AdvancedWebView teamChatWebView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_video_chatroom);
teamChatWebView = (AdvancedWebView) findViewById(R.id.webview_team_video_chat);
teamChatWebView.setListener(this, this);
teamChatWebView.addPermittedHostname("appear.in");
teamChatWebView.loadUrl("https://appear.in/terochat-t192f");
}
@SuppressLint("NewApi")
@Override
protected void onResume() {
super.onResume();
teamChatWebView.onResume();
}
@SuppressLint("NewApi")
@Override
protected void onPause() {
teamChatWebView.onPause();
// ...
super.onPause();
}
@Override
protected void onDestroy() {
teamChatWebView.onDestroy();
// ...
super.onDestroy();
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
super.onActivityResult(requestCode, resultCode, intent);
teamChatWebView.onActivityResult(requestCode, resultCode, intent);
// ...
}
@Override
public void onBackPressed() {
if (!teamChatWebView.onBackPressed()) { return; }
// ...
super.onBackPressed();
}
@Override
public void onPageStarted(String url, Bitmap favicon) {
}
@Override
public void onPageFinished(String url) {
}
@Override
public void onPageError(int errorCode, String description, String failingUrl) {
}
@Override
public void onDownloadRequested(String url, String suggestedFilename, String mimeType, long contentLength, String contentDisposition, String userAgent) {
}
@Override
public void onExternalPageRequest(String url) {
}