refresh a part of the activity
<p>In my activity I have the 15% of the screen for login, it's a TextView and a button:</p>

<pre><code>    &lt;TextView               
        android:id="@+id/registered_text"
        android:color = "@color/white"
        android:layout_width="wrap_content"
        android:textSize="20dip"
        android:layout_height="wrap_content"
        android:layout_marginLeft="10dip"   
        &gt;&lt;/TextView&gt;

        &lt;Button
        style="@style/myButton" 
        android:id="@+id/reg_button" 
        android:layout_width="wrap_content"     
        android:layout_alignParentRight="true"    
        android:layout_marginRight="10dip" 
        android:layout_height="wrap_content"   
    &gt;
    &lt;/Button&gt;       
</code></pre>

<p>The textView value and the Button text and listener depends on the user is register or not:</p>

<pre><code>    loginDB login = new loginDB(context);
    Cursor cursor = login.logData(new String[]{"userJoomla", "idUSER", "name","email"});

    if (cursor.moveToFirst()) {
        userJoomla = cursor.getInt(0);
        userID = cursor.getInt(1);
        name = cursor.getString(2);
        email = cursor.getString(3);

        greeting.setText("Hola " + name);
        loginLogout.setText("Desconectarme");

        loginLogout.setOnClickListener(logout);
    } else {  
        name = "usuario móvil";
        greeting.setText("");
        loginLogout.setText("Identificarme");
        loginLogout.setOnClickListener(newLogin);
    }

    login.close();
</code></pre>

<p>How can I refresh it when a user login or logout?</p>

<p>Thank you in advance</p>
