Lloyd Carroll wrote:

> Use == for starters in your conditional statement.
>

As others have stated, XML doesn't have statements, conditional or 
otherwise, 
and Java comparisons often need 'equals()' rather than '=='.
 

> Waheed Rafiq wrote:
>
>> Hi guys , I am new to android development 
>>
>> for sometime I have try to resolve  the if statement issue within my code 
>> but can't seem to understand why it does not work
>>
>> here is my code that I was learning from online tutorial 
>>
>> <RelativeLayout 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" >
>>
>>
>>     <TextView
>>
>>         android:id="@+id/textView1"
>>
>>         android:layout_width="wrap_content"
>>
>>         android:layout_height="wrap_content"
>>
>>         android:layout_centerHorizontal="true"
>>
>>         android:layout_centerVertical="true"
>>
>>         android:padding="@dimen/padding_medium"
>>
>>         android:text="@string/hello_world"
>>
>>         tools:context=".MainActivity" />
>>
>>
>>     <Button
>>
>>         android:id="@+id/button1"
>>
>>         android:layout_width="wrap_content"
>>
>>         android:layout_height="wrap_content"
>>
>>         android:layout_below="@+id/textView1"
>>
>>         android:layout_centerHorizontal="true"
>>
>>         android:layout_marginTop="59dp"
>>
>>         android:text="Edit me"  // on this line I name the button Edit Me
>>
>>         if(android.text="Hussian Waheed") android.text="Change Me"; // 
>> on this line I am trying to say if the button is "Edit Me" then change this 
>> to "Change Me" 
>>
>>
>> all I get is a error stating my if statment requires a equal , I just 
>> don't understand it. really would like someone to give me a better example 
>> of how to change a button name to different button name. 
>>
>>
>> thanks
>>
>>       
>>
>>        />
>>
>>
>>
>> </RelativeLayout>
>>
>  

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to