Saturday, April 30, 2011

[android-developers] Re: Change UI when executing an instruction

I've made this:
public void onRegistrationDone(String localProfileUri, long
expiryTime) {
updateStatus("Registered to server.");
Log.d("SUCCEED","Registration DONE");

ImageView iconView = (ImageView)
findViewById(R.id.connected);
iconView.setVisibility(1);

}
But the image diesn't shows!
Here is also my XML file:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/
android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent">

<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/sipLabel"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
<ImageView android:id="@+id/connected" android:src="@drawable/
connected" android:layout_below="@id/sipLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_weight="0.35"
android:gravity="center"
android:visibility="invisible" />
</LinearLayout>

What could be the problem?
Thank you very much.


On 30 avr, 16:14, Dianne Hackborn <hack...@android.com> wrote:
> setContentView() completely replaces your current UI with a new one.  If you
> just want to make an image shown, you need to modify the current UI -- for
> example have an ImageView containing the image which you change between
> View.INVISIBLE and View.VISIBLE.
>  On Apr 30, 2011 10:48 AM, "Alaeddine Ghribi" <alaeddineghr...@gmail.com>
> wrote:
>
>
>
>
>
>
>
> > Hello,
> > I want to change the UI(if possible just add an image to the UI) when
> > i'm well connected to the server(i'm developping a SIP application) by
> > adding an imaged "Connected" .
> > In fact, i've made this but i have a FC:
> > public void onRegistrationDone(String localProfileUri, long
> > expiryTime) {
> > updateStatus("Registered to server.");
> > Log.d("SUCCEED","Registration DONE");
> > setContentView(R.layout.connected);
> > }
>
> > connected is an XMl file that has a textview(with same id as the
> > main.xml) and the image that i want to add.
> > How can i do this?
>
> > Thank you very much.
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to android-developers@googlegroups.com
> > To unsubscribe from this group, send email to
> > android-developers+unsubscribe@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate