I'm just starting out, trying to get my feet wet...
Here's my xml:
<?xmlversion="1.0"encoding="utf-8"?>
</LinearLayout>
Here's my xml:
<?xmlversion="1.0"encoding="utf-8"?>
<
LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android"
androidrientation="vertical"
androidrientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
android:layout_height="fill_parent"
>
<TextViewandroid:text="Press the Button"
android:id="@+id/text01"
android:id="@+id/text01"
android:layout_marginLeft = "90dip"
android:layout_marginTop = "150dip"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
</TextView>
android:layout_marginTop = "150dip"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
</TextView>
<Button
android:text="The Button"
android:id="@+id/Button01"
android:text="The Button"
android:id="@+id/Button01"
android:layout_margin="100dip"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
android:layout_width="wrap_content"
android:layout_height="wrap_content">
</Button>
</LinearLayout>
And here's my java:
package com.brian.first_try;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
public class first_try extends Activity
{
{
/** Called when the activity is first created. */
@Override
publicvoid onCreate(Bundle savedInstanceState)
{
final TextView myText = (TextView) findViewById(R.id.text01);
final Button myButton = (Button) findViewById(R.id.Button01);
super.onCreate(savedInstanceState);
// myButton.setOnClickListener(new View.OnClickListener()
// {
// public void onClick(View v)
// {
// myText.setText("Great Job!");
// }
// });
@Override
publicvoid onCreate(Bundle savedInstanceState)
{
final TextView myText = (TextView) findViewById(R.id.text01);
final Button myButton = (Button) findViewById(R.id.Button01);
super.onCreate(savedInstanceState);
// myButton.setOnClickListener(new View.OnClickListener()
// {
// public void onClick(View v)
// {
// myText.setText("Great Job!");
// }
// });
setContentView(R.layout.
main);
}
}
}
It runs fine until I remove the comment //'s. What Am I doing wrong?!!