Application open normal but while opening this activity it says \"App keeps stopping\". I don\'t understand what is the problem. Maybe API level is not compatible with calendar.
You cannot set this code outside of OnCreate method. Because your layout has not been created yet, you cannot findViewById since they activity has no content. You must setContentView
before you do anything regarding your views that will be added to your activity.
final EditText etDate=(EditText) findViewById(R.id.etDate);
Set these objects without initializing them, and then initialize in your onCreate after you setContentView(LAYOUT);
EditText etDate;
public void onCreate(Bundle savedIntanceState) {
....
etDate = findViewById(R.id.etDate);