The Main Activity File

The main activity code is a Java file MainActivity.java. This is the actual application file which ultimately gets converted to a Dalvik executable and runs your application. Following is the default code generated by the application wizard for Hello World! application:


package com.example.helloworld;



import android.os.Bundle; import android.app.Activity; import android.view.Menu; import android.view.MenuItem;



import android.support.v4.app.NavUtils;



public class MainActivity extends Activity {



@Override



public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main);



}



@Override



public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.activity_main, menu); return true;



}



}

 

 

It's only fair to share...Share on FacebookTweet about this on TwitterShare on Google+Share on LinkedInEmail this to someoneBuffer this pageDigg thisFlattr the authorShare on StumbleUponPin on PinterestShare on YummlyShare on VKShare on RedditPrint this pageShare on Tumblr
Related Posts

One Comment

  1. Linda May 25, 2015 Reply

Add a Comment

Your email address will not be published. Required fields are marked *