Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7831835
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T11:54:23+00:00 2026-06-02T11:54:23+00:00

EDIT: My Current solution. Was wrap the json in a div tag and set

  • 0

EDIT: My Current solution. Was wrap the json in a div tag and set it to transparent as well.

I am populating a webview from a json object remotely.

{
"message": "<p style=\"color:#EEEEEE;background-color:transparent;font-family:'Arial Narrow','Nimbus Sans L',sans-serif;\"><\/p><p style=\"color:#EEEEEE;background-color:transparent;font-family:'Arial Narrow','Nimbus Sans L',sans-serif;\">The mission of the Canton Police Department is to protect the lives and properties of the citizens of Canton, enforce all city, state, and federal law<\/p>",
"nationalad": ""
}

I can get the webview background to be transparent. But not semi transparent. When I try this:

webView1.setBackgroundColor(Color.argb(128, 00, 00, 000));

I get a black background with a tiny vertical transparent strip on the right. To make it transparent all the way:

webView1.setBackgroundColor(0x00000000);  

Here is how I am bringing in the JSON:

  try{
                JSONObject json = new JSONObject(result);
                JSONArray nameArray = json.names();
                JSONArray valArray = json.toJSONArray(nameArray);
                for (int i = 0; i < valArray.length(); i++)
                {      
                    WebView webView1 = (WebView) findViewById(R.id.webView1);
                   // webView1.setBackgroundColor(0x00000000);

                    //webView1.loadDataWithBaseURL(null, valArray.getString(0), "text/html", "utf-8", null);   
                    webView1.setBackgroundColor(Color.argb(128, 00, 00, 00));
                }     

EDIT: XML

    <!-- Included header.xml here -->

    <ViewStub
        android:id="@+id/vsHeader"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:inflatedId="@+id/header"
        android:layout="@layout/header" />

    <LinearLayout
        android:id="@+id/linearLayout1"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@drawable/cpd"
        android:gravity="center|center_horizontal|center_vertical"
        android:orientation="vertical"
        android:paddingBottom="50dp" >

        <WebView
            android:id="@+id/webView1"
            android:layout_width="250dp"
            android:layout_height="300dp"
            />

    </LinearLayout>

</LinearLayout>         

enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T11:54:25+00:00Added an answer on June 2, 2026 at 11:54 am

    Change your setBackgroundColor call to the following:

        webView1.setBackgroundColor(0xAA000000);  
    

    This should give you a semi transparent black. The first two entries are the alpha values. The lower the value the more transparent the color will be.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My current solution will suck sometimes EDIT For those who don't understand,see this example:
EDIT: I found a solution for this, you can read it in my answer
Edit 3/02/12: Found another solution that worked by itself without the need for any
Edit: My original title has been sort of changed. I suspect the current title
The web designer has given me HTML which looks like: <div .... style=background: transparent
Edit Ok thats typical, I figure out a possible solution to the problem just
Current solution: user clicks on label and it is switched with a textarea to
I'm having trouble figuring out the solution to this SQL query. Schema Edit :
EDIT: Duplicate of Should Entity Framework Context be Put into Using Statement? I've been
EDIT: Now a Major Motion Blog Post at http://messymatters.com/sealedbids The idea of rot13 is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.