Note that there are some explanatory texts on larger screens.

plurals
  1. POAdding a drawable to a webview
    primarykey
    data
    text
    <p>I have a problem to add a drawable in my webview. I have a webservice to retrieve the html, then I load data like this :</p> <pre><code>webView.loadDataWithBaseURL(null, data.getCgv().getText(), "text/html", "utf8", null); </code></pre> <p>After reading many posts on stackoverflow and other, I've added the following line :</p> <pre><code>webView.setBackgroundColor(0); </code></pre> <p>Then I want display my drawable like this : </p> <pre><code>webView.setBackgroundResource(R.drawable.bg_fond); </code></pre> <p>The two last webview properties are in onCreate() and I load data when I receive the webservice response. Here is my code (I use AndroidAnnotaion + robospice)</p> <pre><code>@ViewById(R.id.webview) protected WebView webView; @AfterViews protected void setAfterViews() { getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayShowHomeEnabled(false); // webView.setBackgroundResource(R.drawable.bg_fond); webView.setBackgroundColor(Color.TRANSPARENT); SpiceRequestRest req = new SpiceRequestRest(CgvData.class, Constants.WS_TEXT_CGV, Utils.getCurrentLanguage(this), Constants.GET); getSpiceManager().execute(req, new CgvListener()); } </code></pre> <p>And the requestListener where I load data:</p> <pre><code>private class CgvListener implements RequestListener&lt;Status&gt; { @Override public void onRequestFailure(SpiceException spiceException) { } @Override public void onRequestSuccess(Status status) { if (status.getStatusCode() == 200) { CgvData data = (CgvData) status; webView.loadDataWithBaseURL(null, data.getCgv().getText(), "text/html", "utf8", null); } } } </code></pre> <p>When I arrive on my activity, it's ok but when I'm scrolling, the activity blinks. I've tested on galaxy s II (4.1) and galaxy note (4.2). Do you know where is the problem ?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload