This Android program displays a simple "Hello World" message. It creates an activity called MainActivity that extends the base Activity class and overrides its onCreate and onCreateOptionsMenu methods. On create, it calls the super method and sets the content view to the activity_main layout. The menu inflater is used to inflate any menu items on create options menu.
1 of 2
Download to read offline
More Related Content
Programa 1
1. PROGRAMA 1; HOLA MUNDO
package com.example.holamundo;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is
present.