80,352
社区成员
发帖
与我相关
我的任务
分享
package com.android.hello;
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
public class HelloAndroid1 extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
TextView tv=new TextView(this);
tv.setText("Hello World");
setContentView(tv);
}
}
public HelloActivity extends Activity
{
public viud onCreate(Bundle bInpt)
{
super.onCreate(bInpt);
TextView txtHello = new TextView(this);
txtHello.setText("Hello,World");
txtHello.setTextLine(1);
txtHello.setTextSize(36);
txtHello.setVisible(View.VISIBLE);
txtHello.setEnable(true);
setContentView(txtHello);
}
}
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="hello">Hello World, Main!</string>
<string name="app_name">组件测试</string>
</resources>