public class Main extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

TextView study_id = (TextView)findViewById(R.id.study_id);
study_id.setOnClickListener(
new OnClickListener(){
@Override
public void onClick(View arg0) {
Toast toast = Toast.makeText(getApplicationContext(), "I am Clicked", Toast.LENGTH_LONG);//提示被点击了
toast.show();
}
});
}
}



<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView android:layout_width="fill_parent" android:id="@+id/study_id" android:text="开始学习" android:layout_weight="2" android:layout_height="wrap_content"></TextView>
<TextView android:layout_width="fill_parent" android:id="@+id/plan_id" android:text="学习计划" android:layout_weight="2" android:layout_height="wrap_content"></TextView>
<TextView android:layout_width="fill_parent" android:id="@+id/about_id" android:text="关于" android:layout_weight="2" android:layout_height="wrap_content"></TextView>
</LinearLayout>