0

I've got this error:

Caused by: java.lang.NullPointerException
        at com.thewayto.doland.Acttimer.onCreate(Acttimer.java:52)

This is the code, the error is in the third line:

       textAlarmPrompt = (TextView)findViewById(R.id.alarmprompt);

    buttonstartSetDialog = (Button)findViewById(R.id.startSetDialog);
    buttonstartSetDialog.setOnClickListener(new OnClickListener(){

        @Override
        public void onClick(View v) {
            textAlarmPrompt.setText("");
            openTimePickerDialog(false);

        }});

}
user2378812
  • 59
  • 1
  • 2
  • 7

1 Answers1

0

buttonstartSetDialog is probably null on that line. Make sure there is a view in your layout with the proper ID, otherwise Android won't find it and findViewById returns null.

Also see: What is a Null Pointer Exception

Community
  • 1
  • 1
Karakuri
  • 38,365
  • 12
  • 84
  • 104