在Android中使用webview姿态打开浏览器后获得白色屏幕
当我尝试在webView上摆姿势时,前3-4秒我会看到白色屏幕,然后浏览器会打开。如果我按back,则只有白色屏幕出现。如果再次按back,则只有白色屏幕出现。因此,我将如何删除此白色屏幕。这是我的代码在Android中使用webview姿态打开浏览器后获得白色屏幕,android,webview,http-post,android-browser,Android,Webview,Http Post,Android Browser,当我尝试在webView上摆姿势时,前3-4秒我会看到白色屏幕,然后浏览器会打开。如果我按back,则只有白色屏幕出现。如果再次按back,则只有白色屏幕出现。因此,我将如何删除此白色屏幕。这是我的代码 import org.apache.http.util.EncodingUtils; import com.google.analytics.tracking.android.EasyTracker; import android.app.Activity;
import org.apache.http.util.EncodingUtils;
import com.google.analytics.tracking.android.EasyTracker;
import android.app.Activity;
import android.os.Bundle;
import android.view.KeyEvent;
import android.webkit.CookieManager;
import android.webkit.CookieSyncManager;
import android.webkit.WebView;
public class HtmlViewerActivity extends Activity {
WebView wv;
String payUrl;
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.web_viewer);
wv = (WebView) findViewById(R.id.webid);
// use cookies to remember a logged in status
CookieSyncManager.createInstance(this);
CookieSyncManager.getInstance().startSync();
CookieManager cookieManager = CookieManager.getInstance();
cookieManager.removeAllCookie();
// getting data from other Activity using bundle
Bundle bundle = new Bundle();
bundle = getIntent().getExtras();
payUrl = bundle.getString("payUrl");
wv.setKeepScreenOn(true);
wv.getSettings().setDomStorageEnabled(true);
wv.getSettings().setBuiltInZoomControls(true);
byte[] post = EncodingUtils.getBytes(payUrl, "BASE64");
wv.postUrl("http://syntheverest.collasapp/app/get_details.php", post);
}
@Override
public void onBackPressed() {
// TODO Auto-generated method stub
if (wv.canGoBack())
wv.goBack();
else
super.onBackPressed();
}
}
试试这个:(YourWebview).setBackgroundColor(0x00000000)代码>
将您的webview设置为透明。是的,正如sid所说,您可以使用进度条
你检查了吗???我试过了,但不起作用。还是一样的问题。谢谢,我试过这段代码,但问题仍然一样,只是在白屏的地方我得到了透明屏。然后你可以实现进度条,直到出现白屏。