package de.anna.cellfreestick; import android.app.ActionBar; import android.content.Intent; import android.net.Uri; import android.os.Environment; import android.provider.MediaStore; import android.support.v7.app.ActionBarActivity; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.Button; import java.io.File; public class Instructions extends ActionBarActivity implements View.OnClickListener { //declaration of variables Button buttonTakePhotoInstructions; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_instructions); //find view elements buttonTakePhotoInstructions = (Button) findViewById(R.id.buttonTakePhotoInstructions); buttonTakePhotoInstructions.setOnClickListener(this); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.menu_instructions2, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle action bar item clicks here. The action bar will // automatically handle clicks on the Home/Up button, so long // as you specify a parent activity in AndroidManifest.xml. int id = item.getItemId(); //noinspection SimplifiableIfStatement if (id == R.id.action_settings) { return true; } return super.onOptionsItemSelected(item); } @Override public void onClick(View view) { //define intent upon click on button Intent intent = new Intent (this, TakePhoto.class); startActivity(intent); } }