andrewcweaver
Newbie
I'm new to development, and i'm trying to make a button display the word "Green" and another button to display "Orange"
I have made the button, and changed the text, but I can't get it do to anything. I have been using this code to attempt to make the button work
<Button android:id="@+id/Button01"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:text="Green!">
android:gravity="bottom"
public class MyActivity extends Activity {
protected void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.content_layout_id);
final Button button = (Button) findViewById(R.id.button_id);
button.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
// Perform action on click android:background="@color/green"</Button>
}
});
}
}
Please help.
I have made the button, and changed the text, but I can't get it do to anything. I have been using this code to attempt to make the button work
<Button android:id="@+id/Button01"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:text="Green!">
android:gravity="bottom"
public class MyActivity extends Activity {
protected void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.content_layout_id);
final Button button = (Button) findViewById(R.id.button_id);
button.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
// Perform action on click android:background="@color/green"</Button>
}
});
}
}
Please help.