Back to project page open311-android.
The source code is released under:
GNU General Public License
If you think the Android project open311-android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
/** * @copyright 2012 City of Bloomington, Indiana * @license http://www.gnu.org/licenses/gpl.txt GNU/GPL, see LICENSE.txt * @author Cliff Ingham <inghamn@bloomington.in.gov> */// w w w. ja v a2 s .c o m package gov.in.bloomington.georeporter.activities; import gov.in.bloomington.georeporter.R; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; public abstract class BaseActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); getActionBar().setDisplayHomeAsUpEnabled(true); } @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.main, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { Intent intent; switch (item.getItemId()) { case android.R.id.home: intent = new Intent(this, MainActivity.class); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(intent); return true; case R.id.menu_settings: intent = new Intent(this, SettingsActivity.class); startActivity(intent); return true; case R.id.menu_report: intent = new Intent(this, ReportActivity.class); startActivity(intent); return true; case R.id.menu_archive: intent = new Intent(this, SavedReportsActivity.class); startActivity(intent); return true; case R.id.menu_about: intent = new Intent(this, AboutActivity.class); startActivity(intent); return true; default: return super.onOptionsItemSelected(item); } } }