title: I wrote a witre/read android app following a tutorial, but changed some stuff for my purposes. The app crashes right when it starts
body: <p>I don't think any of my other code is crashing the app because it crashes before it even starts. Other solutions to similar problems have said that its because of setContentView(R.layout.yourlayout) but im used my layout so i dont think that would be the problem.</p>
  
  <p>public class WriteRead extends Activity implements OnClickListener {</p>
  
  <pre><code>public Button btnSave = (Button) findViewById(R.id.btnSave);
  public Button btnNext = (Button) findViewById(R.id.btnNext);
  public EditText Name = (EditText) findViewById(R.id.editText1); 
  public EditText DOB = (EditText) findViewById(R.id.editText2); 
  public EditText HealthNum = (EditText) findViewById(R.id.editText3); 
  public EditText Arrival = (EditText) findViewById(R.id.editText4); 
  public EditText HeartRate = (EditText) findViewById(R.id.editText5); 
  public EditText Temp = (EditText) findViewById(R.id.editText6); 
  public EditText BPressure = (EditText) findViewById(R.id.editText7); 
  String nametxt = Name.getText().toString();
  String healthCardtxt = HealthNum.getText().toString();
  String dobtxt = DOB.getText().toString();
  String arrivaltxt = Arrival.getText().toString();
  String heartRatetxt = HeartRate.getText().toString();
  String Temptxt = Temp.getText().toString();; 
  String bptxt = BPressure.getText().toString();
  
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_write_read);
  </code></pre>