您的位置:首页 > 移动开发 > Android开发

Android初学:联系创建Activity

2016-03-17 22:04 465 查看
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>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: