Android初学:联系创建Activity
public class Activity2 extends Activity{ @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // setContentView(R.layout.layout2); System.out.println("这是我运行的第一个Activity"); Log.d("text","Log输出的信息"); } }
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent">//匹配父窗口 <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="大家好" />//内容包裹 </LinearLayout>