Code example for FragmentActivity

Methods: finish

0
 
	@Override 
	public boolean onOptionsItemSelected(MenuItem item) {
		switch(item.getItemId()) {
			case android.R.id.home:
				finish(); 
				return true; 
		} 
		return super.onOptionsItemSelected(item);
	} 
 
	@Override 
	public void onClick(View v) {
		Intent i = new Intent(Intent.ACTION_VIEW);
		i.setData(Uri.parse("http://" + getString(R.string.two_toasters_url)));
		startActivity(i);
	} 
 
	@Override 
	public boolean onLongClick(View v) {
		Toast.makeText(TwoToastersActivity.this, "Boom Toasted!", Toast.LENGTH_SHORT).show();