you have "overridden" the wrong onCreate method:
@Override
public void onCreate(Bundle savedInstanceState, PersistableBundle
persistentState)
you should use this instead:
@Override
public void onCreate(Bundle savedInstanceState){...code}
onCreate(Bundle) is used for initialization mean where your all UI initialization like view are done ,docs link for depth details
onCreate(Bundle, PersistableBundle) as it, itself suggesting , it is used for persistent mean reuse the old intent (supplied first time to this activity) while recreating it , you can enable reusing by adding a persistableMode flag to your activity so that activity will be persisted across reboots . try this doc link for other options details .
Note : You can only use onCreate(Bundle, PersistableBundle) in API level 21(Android Lollipop 5.0) or above.