3

while I am trying to postUrl on webView first 3-4 second I am getting white screen then browser open.If I press back only white screen come.If again I press back then only it come on activity.So how I will remove this white screen.Here is my code.

      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();

        }
    }
Faiz Anwar
  • 658
  • 2
  • 9
  • 18

2 Answers2

0

Try this : (YourWebview).setBackgroundColor(0x00000000);

Set your webview to transparent.

Siddharth_Vyas
  • 9,972
  • 10
  • 39
  • 69
0

Yeah, as sid said you can use progress bar.

webview with progressbar

Yauraw Gadav
  • 1,706
  • 1
  • 18
  • 39