I once read a tutorial but since then my phone had been wiped out by XBOX, and so I lost it. I want there to be a button on the MainActivity to open up an AlertDialog Box stating app info such as version number, about current version, what android version this one is for, etc.
package com.apw.games.rpg.medieval;
import android.app.*;
import android.os.*;
import android.view.*;
import android.widget.*;
import android.content.*;
import android.util.*;
import android.graphics.*;
public class MainActivity extends Activity
{
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
@Override public void onNothingSelected(AdapterView<?> parent) {
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.menu, menu); return true; }
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle item selection
switch (item.getItemId()) {
case R.id.quit:
Intent intent = new Intent(this, Exit.class);
startActivity(intent);
return true;
case R.id.new_game:
Intent i = new Intent(this, New_Game.class);
startActivity(i);
return true;
case R.id.visit_site:
Intent inte = new Intent(this, Site.class);
startActivity(inte);
return true;
default: return super.onOptionsItemSelected(item);
}}