Notifiy the user in a Thread
<p>Hy!!</p>

<p>Code:</p>

<pre><code>final ProgressDialog pd = ProgressDialog.show(Main.this,"","Loading. Please wait...", true);
pd.show();
 Thread t = new Thread() {
             public void run(){
            result = GetData("link", nameValuePairs);
             pd.dismiss();
             if(result.contains("Logged IN"))
          { 
           user=etuser.getText().toString();
          }
          else
          {
           fail();
          }
             }
           };
           t.start();
</code></pre>

<p>Fail Function:</p>

<pre><code>public void  fail ()
    {
     final TextView tverror = new TextView(this);
     tverror.setText("FAIL");
     linear_l.addView(tverror);
    }
</code></pre>

<p>Error: It isn't possible to add a view  during the run in the thread.</p>

<p>Is there any workaround?</p>
