FileDocCategorySizeDatePackage
HelloWorld.javaAPI DocAndroid 1.5 API2090Wed May 06 22:41:08 BST 2009com.example.android.apis.app

HelloWorld

public class HelloWorld extends android.app.Activity
Simple example of writing an application Activity. Hello World

This demonstrates the basic code needed to write a Screen activity.

Demo

App/Activity/Hello World

Source files

src/com.example.android.apis/app/HelloWorld.java The Hello World Screen implementation
/res/any/layout/hello_world.xml Defines contents of the screen

Fields Summary
Constructors Summary
Methods Summary
protected voidonCreate(android.os.Bundle savedInstanceState)
Initialization of the Activity after it is first created. Must at least call {@link android.app.Activity#setContentView setContentView()} to describe what is to be displayed in the screen.

        // Be sure to call the super class.
        super.onCreate(savedInstanceState);

        // See assets/res/any/layout/hello_world.xml for this
        // view layout definition, which is being set here as
        // the content of our screen.
        setContentView(R.layout.hello_world);