我最近启动了一个测验应用程序,我找到了一个很好的网站,我可以在其中使用图像、多个响应进行测验,并在开始时显示分数。
我不知道我的错误在哪里,因为 ggoogle.com 有效,但我的测验没有。
这是我要加载的链接surveyanyplace.com/s/pozitiemers
我的课:
public class ChestionareA extends MainActivity2A {
/** Called when the activity is first created. */
WebView web;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.chestionare_a);
web = (WebView) findViewById(R.id.webview01);
web.setWebViewClient(new myWebClient());
web.getSettings().setJavaScriptEnabled(true);
web.loadUrl("http://surveyanyplace.com/s/pozitiemers/");
}
public class myWebClient extends WebViewClient
{
@Override
public void onPageStarted(WebView view, String url, Bitmap favicon) {
// TODO Auto-generated method stub
super.onPageStarted(view, url, favicon);
}
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
// TODO Auto-generated method stub
view.loadUrl(url);
return true;
}
}
// To handle "Back" key press event for WebView to go back to previous screen.
@Override
public boolean onKeyDown(int keyCode, KeyEvent event)
{
if ((keyCode == KeyEvent.KEYCODE_BACK) && web.canGoBack()) {
web.goBack();
return true;
}
return super.onKeyDown(keyCode, event);
}
}