Skip to content

Commit

Permalink
Fixed crash in app on changing orientation
Browse files Browse the repository at this point in the history
  • Loading branch information
mrudultora committed May 5, 2021
1 parent 4fb5149 commit 3803191
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -224,4 +224,9 @@ public void onDirectColorSelected(int color, int position) {
bottomSheetDialog.show();
}

@Override
public void onViewStateRestored(@Nullable Bundle savedInstanceState) {
super.onViewStateRestored(savedInstanceState);
tabLayout = mainActivity.tabLayout;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@
package com.mrudultora.colorpickerapp;

import android.content.Context;
import android.content.res.Configuration;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.os.Parcelable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
Expand Down Expand Up @@ -93,4 +95,10 @@ public void onCancel() {
// colorPickerPopUp.getPositiveButton().setTextColor(Color.BLUE);

}

@Override
public void onViewStateRestored(@Nullable Bundle savedInstanceState) {
super.onViewStateRestored(savedInstanceState);
tabLayout = mainActivity.tabLayout;
}
}

0 comments on commit 3803191

Please sign in to comment.