×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Java
Posted by: Massimo Zappino
Added: Nov 22, 2010 1:09 PM
Views: 135
A simple snippet for running an Hello World application in Android
  1. package com.example.helloandroid;
  2.  
  3. import android.app.Activity;
  4. import android.os.Bundle;
  5. import android.widget.TextView;
  6.  
  7. public class HelloAndroid extends Activity {
  8.    /** Called when the activity is first created. */
  9.    @Override
  10.    public void onCreate(Bundle savedInstanceState) {
  11.        super.onCreate(savedInstanceState);
  12.        TextView tv = new TextView(this);
  13.        tv.setText("Hello, Android");
  14.        setContentView(tv);
  15.    }
  16. }