【发布时间】:2014-07-08 07:44:28
【问题描述】:
在我的项目中,我需要在同一个链接中打开包含嵌入音频和视频的 url,我尝试了很多方法来打开,但我无法获得输出和很多链接,直到不清楚类型的问题。我使用的是 2.3 版本的设备
我用过intent方法
Intent newIntent = new Intent(Intent.ACTION_VIEW,
Uri.parse("http://survey.euro.confirmit.com/extwix/test_p1837764731.aspx?__etk=GMYRUFKMQZTQ&ftouch=1679&pin=346"));
startActivity(newIntent);
我也使用了 WebView 方法,直到现在我无法让它工作
web = (WebView) surveyView.findViewById(R.id.webView_survey);
settings = web.getSettings();
settings.setBuiltInZoomControls(true);
settings.setJavaScriptEnabled(true);
settings.setAllowFileAccess(true);
settings.setPluginsEnabled(true);
settings.setGeolocationEnabled(true);
// settings.setJavaScriptCanOpenWindowsAutomatically(true);
// settings.setSupportMultipleWindows(true);
web.requestFocus(View.FOCUS_DOWN);
web.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
case MotionEvent.ACTION_UP:
if (!v.hasFocus()) {
v.requestFocus();
}
break;
}
return false;
}
});
web.loadUrl("http://survey.euro.confirmit.com/extwix/test_p1837764731.aspx?__etk=GMYRUFKMQZTQ&ftouch=1679&pin=346");
}
谁能帮我解决这个问题
【问题讨论】:
-
能否提供演示链接。也许我可以帮助你
-
那是我正在使用的检查我在编码中使用的链接
-
我打开了链接,但那里没有任何音频/视频
-
只需单击前进按钮并转到下一个屏幕,您将在其中找到音频和视频
-
好的...您正在测试哪个版本以及使用 webview 时遇到了什么错误或遇到了什么问题?
标签: android url android-webview android-mediaplayer android-browser