Google Android之使用XML布局
package org.andylee1988;
import android.app.Activity;
import android.os.Bundle;
public class HelloAndylee1988 extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super .onCreate(savedInstanceState);
setContentView(R.layout. main );
}
}
编辑main.xml,输入以下代码:
<? xml version = "1.0" encoding = "utf-8" ?>
< TextView xmlns:android = "http://schemas.android.com/apk/res/android"
android:layout_width = "fill_parent"
android:layout_height = "fill_parent"
android:text = "@string/hello" />