Skip to content

Instantly share code, notes, and snippets.

@leonguyen
Last active December 16, 2015 00:59
Show Gist options
  • Select an option

  • Save leonguyen/5351695 to your computer and use it in GitHub Desktop.

Select an option

Save leonguyen/5351695 to your computer and use it in GitHub Desktop.
Android Lab: Intro - The MainActivity program
package com.example.androidlab;
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.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment