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 9183273
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T18:45:45+00:00 2026-06-17T18:45:45+00:00

This question has probably been asked a lot many times.. Yes! I am facing

  • 0

This question has probably been asked a lot many times.. Yes! I am facing the so called “black screen problem”..
My first activity is which the main activity, in which login is done, and this activity is followed by the next one which is a simple summary report of the user’s account.
Now, for this report, i fetch the dataset, parse it and use it to build the table dynamically.
The villan black screen appears here!! The report, as in the table is rendered properly, but upon that screen, this black tranluscent layer keeps appearing.
I tried everything, using handlers, asynctask, translucent theme but nothing helps!! The villan still appears when my summary report loads. It goes away if i press the “Back” button, and the screen appears normal, as it is expected to be when it loads the first time.. I cant figure out what exactly is going wrong, whether, its my coding approach(dynamically generating the table) or it is an emulator problem or what.

My emulator details are as follows:
CPU:ARM
Target: Android 2.3.3
skin: WVGA800
sd card:1024M

Someone please rescue me!!

EDIT:
In my Second activity i do the following:

   public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_summary_report);
        ad = new AlertDialog.Builder(this).create();
        boolean is = IsConnectedToNetwork(); 
        if (is == true){
                Handler execWS = new Handler();
                execWS.post(callWS);//Fetch Data via web service and parse it
                if(result != null){
                    Handler genUI = new Handler();
                    genUI.post(createUI);// generate the table based on "result". ie. in a for loop i create textviews and append it to the table layout
                }
            }
        else{
            Error = "Connection Failed. Try Again!";
        }
        if(Error.length() != 0){
        ad.setMessage(Error);
        ad.setTitle("Error..");
            ad.show();
        }
    }

My Xml layout for the second activity..

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:baselineAligned="false"
    android:gravity="center"
    android:orientation="vertical">

    <TableLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:padding="5dip">
            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_horizontal"
                android:contentDescription="@string/Logo"
                android:src="@drawable/complogo" 
                android:gravity="top"/>
            <TextView
                android:id="@+id/lblLoginInfo"  
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:gravity="center_horizontal"/>
    </TableLayout>


    <TableLayout
        android:id="@+id/tblSummRep"
        android:layout_width="wrap_content"
        android:layout_height="0dp"
        android:layout_weight="4"
        android:padding="5dip">
    </TableLayout>
    <TableLayout
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1"
        android:padding="5dip">

            <TextView
                android:id="@+id/AppName"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:gravity="center"
                android:text="@string/AppName"
                android:textColor="#ff6600" />

            <TextView
                android:id="@+id/AppVersion"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:gravity="center"
                android:text="@string/AppVersion"
                android:textColor="#ff6600" />

            <TextView
                android:id="@+id/Disclaimer"
                        android:gravity="center"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="@string/Disclaimer"                   
                android:textColor="#ff6600" />
    </TableLayout>
</LinearLayout>

I append the textview to “tblSummRep”..

UPDATE
my asynctask class..

   private class ShareWork extends AsyncTask<Void, Void, Boolean>{
        ProgressDialog pDlg;
        //String[][] result = null;
        protected void onPreExecute(){
            pDlg.setMessage("Please wait while the Report Loads...");
            pDlg.show();
        }

        @Override
        protected Boolean doInBackground(Void... params) {
            boolean RetVal = false;
            //my fetch code
            return RetVal;
        }


        protected void onPostExecute(Boolean value){
            if(value == true){
                pDlg.setMessage("Please try again later!!");
                pDlg.show();
            }
            else{
                createUI.run();

            }
        }
    }
  • 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-17T18:45:46+00:00Added an answer on June 17, 2026 at 6:45 pm

    I do not know what do you refer to by “black screen problem”, but you state that you are fetching data (I guess from a remote server) and that happens. That sounds to me about blocking the UI thread. In which method of the activity are you fetching the data (maybe in the onCreate)? You should not perform time-consuming actions on the graphical thread, such as querying a remote server (which could take some seconds). In these cases always an AsyncTask should be used. The user should receive some feedback about what is going on in the background, so using a ProgressBar is normally recommendable (or at least a spinner).

    You can take a look about how to solve a similar problem with an AsyncTask here.

    Update

    You have just posted your code. The problem lies (as I presumed) in this line of code:

    execWS.post(callWS);//Fetch Data via web service and parse it
    

    I guess this is a WS call. You are blocking here the UI thread. Create an AsyncTask the same way as the one of the link I provided, and upon completion of the task execute the rest of the code (display error or the dynamic table with the data).

    Your AsyncTask could look like this (I have not tried it):

    private class LoadTableTask extends AsyncTask<URL, Integer, Object> {
         protected Object doInBackground(URL... urls) {
             Handler execWS = new Handler();
             execWS.post(urls[0]);//Fetch Data via web service and parse it
             return result;
         }
    
         protected void onProgressUpdate(Integer... progress) {
             //Not used in your case. It would be a good idea to create an undefined progress dialog in your case
         }
    
         protected void onPostExecute(Object result) {
             if(result != null){
                    Handler genUI = new Handler();
                    genUI.post(createUI);// generate the table based on "result". ie. in a   for loop i create textviews and append it to the table layout
             }
    
         }
     }
    

    Your onCreate() method would be replaced by:

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_summary_report);
        ad = new AlertDialog.Builder(this).create();
        boolean is = IsConnectedToNetwork(); 
        if (is == true){
                new LoadTableTask().execute(callWS);
            }
        else{
            Error = "Connection Failed. Try Again!";
        }
        if(Error.length() != 0){
        ad.setMessage(Error);
        ad.setTitle("Error..");
            ad.show();
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This question probably has been asked many times over here, without yielding useful answers.
I know this question has probably been asked so many times here, but I
I realize this question has probably been asked numerous times, but I have not
I feel like this question has probably been asked a thousand times already, so
This question has probably been asked a dozen times on Stack Overflow (e.g. (
I think probably this question has been asked/answered several times before my post. But
How many indexes should I use? This question has been asked generally multiple times,
I know this question has been asked many times here and elsewhere before as
probably this question has been asked in many forms before but still I think
this question has probably been asked before, but i'm stuck and i've tried a

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.