Note that there are some explanatory texts on larger screens.

plurals
  1. POGetting rid of the black screen
    primarykey
    data
    text
    <p>This question has probably been asked a lot many times.. Yes! I am facing the so called "black screen problem"..<br> 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.<br> 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.<br> 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. </p> <p><code>My emulator details are as follows:</code><br> <code>CPU:ARM</code><br> <code>Target: Android 2.3.3</code><br> <code>skin: WVGA800</code><br> <code>sd card:1024M</code> </p> <p>Someone please rescue me!!</p> <p><strong>EDIT:</strong><br> In my Second activity i do the following: </p> <pre><code> 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(); } } </code></pre> <p>My Xml layout for the second activity..</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;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"&gt; &lt;TableLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="5dip"&gt; &lt;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"/&gt; &lt;TextView android:id="@+id/lblLoginInfo" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:gravity="center_horizontal"/&gt; &lt;/TableLayout&gt; &lt;TableLayout android:id="@+id/tblSummRep" android:layout_width="wrap_content" android:layout_height="0dp" android:layout_weight="4" android:padding="5dip"&gt; &lt;/TableLayout&gt; &lt;TableLayout android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" android:padding="5dip"&gt; &lt;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" /&gt; &lt;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" /&gt; &lt;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" /&gt; &lt;/TableLayout&gt; &lt;/LinearLayout&gt; </code></pre> <p>I append the textview to "tblSummRep"..</p> <p><strong>UPDATE</strong> my asynctask class..</p> <pre><code> private class ShareWork extends AsyncTask&lt;Void, Void, Boolean&gt;{ 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(); } } } </code></pre>
    singulars
    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.
 

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