0
我在WebView内部显示了一些图像,并在GridView内显示了此webview,并且我希望在图像单击后以全屏模式(新活动)显示每个图像,这是可能的? 如果有可能我应该使用onclick事件? Webview.onclick或gridview.onitemclick ...?Android:在全屏模式下从webview打开图像
这是我在网页视图显示图像
WebView webview=(WebView)myView.findViewById(R.id.wv_tool_image);
webview.getSettings().setLoadWithOverviewMode(true);
webview.getSettings().setUseWideViewPort(true);
webview.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);
webview.setScrollbarFadingEnabled(false);
String html = "<html><body>" + "<img src=\"" + SaveSettings.ServerURL +"Images/"+ imagepath+ "\" width=\"100%\" /></body></html>";
webview.setInitialScale(30);
webview.loadDataWithBaseURL(null, html, "text/html", "UTF-8", null);
感谢@cutiko,但如何通过每个图像的URL点击到全屏活动和ImageView的或其他的WebView显示呢? –
何!使用putExtra(“YOUR_KEY”,theUrl)将其添加到您的意图中;然后通过getIntent()获取它在另一个Activity中。getStringExtra(“YOUR_KEY”); – cutiko
以及如何将该网址或显示在imageView? @cutiko –