这是小生第一次在ITeye上发话,其实在新浪微博上已经关注蒋涛先生很久了。(PS:因为JavaEye被CSDN收购,而现在改名ITeye)。附上源代码:
package example.androidhelloworld;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.widget.TextView;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
TextView tv1=new TextView(this);
tv1.setText("Hello World!\nHello Android!\n
这是我编写的第一个安卓应用程序。");
setContentView(tv1);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
}
package example.androidhelloworld;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.widget.TextView;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
TextView tv1=new TextView(this);
tv1.setText("Hello World!\nHello Android!\n
这是我编写的第一个安卓应用程序。");
setContentView(tv1);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
}