Back to project page garageoPIner-androidApp.
The source code is released under:
Apache License
If you think the Android project garageoPIner-androidApp listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.wirthual.garageopiner.activities; // w w w .j a va2 s . com import android.app.Activity; import android.app.Fragment; import android.content.Intent; import android.os.Bundle; import android.preference.PreferenceManager; import android.view.Menu; import android.view.MenuItem; import com.wirthual.garageopiner.R; import com.wirthual.garageopiner.fragments.MainFragment; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Fragment mainFragment = new MainFragment(); if (savedInstanceState == null) { PreferenceManager.setDefaultValues(getApplicationContext(), R.xml.settings, true); getFragmentManager().beginTransaction().add(R.id.container,mainFragment).commit(); } } @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.main, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { int id = item.getItemId(); if (id == R.id.action_settings) { Intent i = new Intent(this, SettingsActivity.class); startActivity(i); return true; } if (id == R.id.action_timetable) { Intent i = new Intent(this, TimeTableActivity.class); startActivity(i); return true; } return super.onOptionsItemSelected(item); } }