Ok my pattience is gone now...I tried for 30 minutes to make this simple thing work but I failed so bad.Maybe it is because I started directly with android,no java...I studied c++ before,and in c++ this was so easy to do...
I have a button in a xml file:
<Button android:text="Button" android:layout_width="wrap_content" android:id="@+id/button1" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_alignParentLeft="true" android:layout_marginBottom="108dp"> </Button> And in my java file I have a string like this:
String test = new String(); test = "google"; I 've already set up the onclick listener for the button so there is no problem. My question is if:
Button buttonx = (Button)findViewById(R.id.button1); How can I compare if onClick(onclick code is already made) buttonx's text = the string test that is "google".
I tried with getText,setText...but nothing...