Hello!
I\'m just starting in Android Studio. I searched for a matching question but no joy, please yell out if you\'ve seen this one already!
My main activity ha
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.
Check weather you have set the correct layout for the setContentView() method of your second activity.
You can just go to dependencies in build.gradle file and add this line there.. & try.
implementation 'com.android.support:appcompat-v7:28.0.0-alpha1'
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.
In my case, I changed device in Android Virtual Divice Manager and this fix problem