Android Studio: New activity opens as blank screen
Have you set the layout for your activity in the line setContentView() like this. Here activity_second is the activity layout of my SecondActivity
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_second);
}
if not then your activity will show up as blank. Hope this solves your problem.
It sometimes happens when instead of overloading
protected void onCreate(Bundle savedInstanceState) {
you end up overloading
public void onCreate(@Nullable Bundle savedInstanceState, @Nullable PersistableBundle persistentState)
instead. Make sure the onCreate with only savedInstanceState as a argument is overloaded.