What i am trying to do:: I am trying to save the data entered into edittext and spinner onorientation change
What is happening::: I am not able to save the data, how can i resolve this
MainActivity.java
public class MainActivity extends FragmentActivity {
Fragment_A frgObj;
#Override
protected void onCreate(Bundle arg0) {
super.onCreate(arg0);
Log.d("MAIN-ACTIVITY", "onCreate");
setContentView(R.layout.activity_main);
}
#Override
protected void onStart() {
super.onStart();
Log.d("MAIN-ACTIVITY", "onStart");
frgObj=Fragment_A.newInstance();
getSupportFragmentManager().beginTransaction().replace(R.id.container, frgObj).addToBackStack(null).commit();
}
public void onSaveInstanceState(Bundle outState){
getSupportFragmentManager().putFragment(outState,"myfragment",frgObj);
}
public void onRetoreInstanceState(Bundle inState){
frgObj = (Fragment_A) getSupportFragmentManager().getFragment(inState,"myfragment");
}
}
Fragment_A.java
public class Fragment_A extends Fragment{
Button btn;
Spinner spinner;
EditText editText;
SeekBar seekBar;
public static Fragment_A newInstance() {
Log.d("FRAGMENT-A", "newInstance");
Fragment_A fragment = new Fragment_A();
return fragment;
}
#Override
public void onAttach(Activity activity) {
Log.d("FRAGMENT-A", "onAttach");
super.onAttach(activity);
}
#Override
public void onCreate(Bundle savedInstanceState) {
Log.d("FRAGMENT-A", "onCreate");
super.onCreate(savedInstanceState);
}
#Override
public void onSaveInstanceState(Bundle outState) {
Log.d("FRAGMENT-A", "onSaveInstanceState");
super.onSaveInstanceState(outState);
//City Spinner state
outState.putString("editText", editText.getText().toString());
outState.putInt("yourSpinner", spinner.getSelectedItemPosition());
}
#Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
Log.d("FRAGMENT-A", "onCreateView");
View view=inflater.inflate(R.layout.fragment_a, container, false);
btn=(Button) view.findViewById(R.id.buttonId1);
spinner=(Spinner) view.findViewById(R.id.spinnerId1);
editText=(EditText) view.findViewById(R.id.editTextId1);
seekBar=(SeekBar) view.findViewById(R.id.seekBarId1);
return view;
}
#Override
public void onActivityCreated(Bundle savedInstanceState) {
Log.d("FRAGMENT-A", "onActivityCreated");
super.onActivityCreated(savedInstanceState);
if (savedInstanceState != null) {
//City Spinner state
editText.setText(savedInstanceState.getString("editText"));
spinner.setSelection(savedInstanceState.getInt("yourSpinner", 0));
}
}
#Override
public void onStart() {
Log.d("FRAGMENT-A", "onStart");
super.onStart();
btn.setOnClickListener(new OnClickListener() {
#Override
public void onClick(View v) {
Log.d("FRAGMENT-A", "button Clicked");
Fragment_B frgObj=Fragment_B.newInstance();
getActivity().getSupportFragmentManager().beginTransaction().replace(R.id.container, frgObj,"Fragment_B").addToBackStack(null).commit();
}
});
}
}
I don't think you need to change anything in your activity other than call super.onSaveInstanceState(Bundle). Saving the data onSaveInstanceState in the fragment should be enough. I would put the restoring logic in onCreateView instead of onActivityCreated. onCreateView is guaranteed to be called whenever the fragment is recreated however this is not the case with onActivityCreated.
An other thing you can try is not going any of this and using setRetainInstance(true) which should retain your instance variables through orientation change.
Related
in my fragment, my button changes it's visibility to GONE whenever I click on it.
I want the visibility to remain GONE when i rotate my screen.
I am using onSaveInstanceState but I would like help on what to add in for the outState.
Any help would be greatly appreciated, thanks!
public class PlaylistsFragment extends Fragment {
private Button add1;
#Nullable
#Override
public View onCreateView(#NonNull LayoutInflater inflater, #Nullable ViewGroup container, #Nullable Bundle savedInstanceState) {
return inflater.inflate(R.layout.fragment_playlists, container, false);
}
#Override
public void onSaveInstanceState(#NonNull Bundle outState) {
super.onSaveInstanceState(outState);
outState.
}
#Override
public void onViewCreated(final View view, #Nullable final Bundle savedInstanceState) {
final Button add1 = (Button) getView().findViewById(R.id.p_add1);
add1.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
add1.setVisibility(View.GONE);
}
});
}
}
Try this:
#Override
public void onSaveInstanceState(Bundle savedInstanceState) {
super.onSaveInstanceState(savedInstanceState);
// Save UI state changes to the savedInstanceState.
savedInstanceState.putInt("button_visibility", add1.getVisibility());
}
#Override
public void onRestoreInstanceState(Bundle savedInstanceState) {
super.onRestoreInstanceState(savedInstanceState);
// Restore UI state from the savedInstanceState.
myButtonVisibility = savedInstanceState.getInt("button_visibility", 0);
}
For instance in onCreate:
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
add1 = (Button)findViewById(R.id.p_add1);
if (savedInstanceState != null) {
int buttonVisibility = savedInstanceState.getInt("button_visibility", 0);
// here will IDE complaint about setting only integer
add1.setVisibility(buttonVisibility == View.VISIBLE ? View.VISIBLE : View.GONE)
}
}
If you have more question you should definitely check out this tutorial:
saveInstanceState tutorial
Enjoy.
I have three fragments in the same activity, let says FragmentA, FragmentB and FragmentC
Let´s say that FragmentA sends an int to FragmentB so in the FragmentA I have:
//FRAGMENT_A
#Override
public void onDestroy() {
super.onDestroy();
EventBus.getBus().register(this);
}
#Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
EventBus.getBus().register(this);
}
private void registerEventBus(int i) {
EventBus.getBus().post(i);
}
FragmentB received the int so:
//FRAGMENT_B
#Override
public void onCreate(#Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
EventBus.getBus().register(this);
}
#Override
public void onDestroyView() {
super.onDestroyView();
EventBus.getBus().unregister(this);
}
#Subscribe
public void getBusData(int data) {
//whatever
}
But now I have to send a double from FagmentB to FragmentC, I have created a new Bus class so now in the FragmentB, I have
//Fragment_B
#Override
public void onCreate(#Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
EventBus.getBus().register(this);
EventBus2.getBus.register(this)
}
#Override
public void onDestroyView() {
super.onDestroyView();
EventBus.getBus().unregister(this);
EventBus2.getBus..unregister(this)
}
#Subscribe
public void getBusData(int data) {
//whatever
}
private void createEventBus2(double number){
EventBus2.post(number);
}
And finally the FragmentC
//FragmentC
#Override
public void onCreate(#Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
EventBus2.getBus().register(this);
}
#Override
public void onDestroyView() {
super.onDestroyView();
EventBus2.getBus().unregister(this);
}
#Subscribe
public void getBus2Data(double data) {
//whatever
}
From FragmentA to FragmentB works perfectly but in the FragmentC I have never get the double data value.
What am I doing wrong?
I am trying to design an Android application, in that application i have sent the data from First Activity to Second Activity. In the Second Activity I am using this code
#Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
}
#Override
protected void onRestoreInstanceState(Bundle savedInstanceState) {
super.onRestoreInstanceState(savedInstanceState);
}
to save the data when application moves to landscape to portrait mode but in my application even i am using both of these but the data is not being saved. On rotation the data is getting destroyed which application is having in EditText View.
Please Check the below code, give the suggestions where i am doing the mistake to save the data
MainActivity.java
public class MainActivity extends AppCompatActivity {
EditText name,age;
TextView text_name,text_age;
Button btn;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
name=(EditText) findViewById(R.id.name);
age=(EditText) findViewById(R.id.age);
text_name=(TextView) findViewById(R.id.name_edit);
text_age=(TextView) findViewById(R.id.name_age);
btn=(Button) findViewById(R.id.click);
//Button Click to send data to another activity
btn.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View view) {
Bundle bundle=new Bundle();
String user_name=name.getText().toString();
String user_age=age.getText().toString();
bundle.putString("UName",user_name);
bundle.putString("UAge",user_age);
Intent intent=new Intent(MainActivity.this,SecondClass.class);
intent.putExtras(bundle);
startActivity(intent);
}
});
}
}
SecondClass.java
public class SecondClass extends Activity {
EditText name,age;
TextView text_name,text_age;
String namer,ager;
private String savedName,savedAge;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.second_activity_layout);
name=(EditText) findViewById(R.id.name);
age=(EditText) findViewById(R.id.age);
text_name=(TextView) findViewById(R.id.name_edit);
text_age=(TextView) findViewById(R.id.name_age);
if (savedInstanceState!=null)
{
savedInstanceState.get(savedName);
name.setText(savedName);
savedInstanceState.get(savedAge);
age.setText(savedAge);
}
if (savedInstanceState==null)
{
Intent i=getIntent();
Bundle bundle=i.getExtras();
namer=bundle.getString("UName");
name.setText(namer);
ager=bundle.getString("UAge");
age.setText(ager);
}
}
#Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
outState.putString(savedName,namer);
outState.putString(savedAge,ager);
}
#Override
protected void onRestoreInstanceState(Bundle savedInstanceState) {
super.onRestoreInstanceState(savedInstanceState);
if (savedInstanceState!=null)
{
savedInstanceState.get(savedName);
name.setText(savedName);
savedInstanceState.get(savedAge);
age.setText(savedAge);
}
if (savedInstanceState==null)
{
Intent i=getIntent();
Bundle bundle=i.getExtras();
namer=bundle.getString("UName");
name.setText(namer);
ager=bundle.getString("UAge");
age.setText(ager);
}
}
}
You put and get value in saved instance with a key, and first put your data in
'outState' then call '
super.onSaveInstanceState(outState);
try this:
public class SecondClass extends Activity {
private static final String SAVED_NAME="savedName";
private static final String SAVED_AGE="savedAge";
EditText name,age;
TextView text_name,text_age;
String namer,ager;
private String savedName,savedAge;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.second_activity_layout);
name=(EditText) findViewById(R.id.name);
age=(EditText) findViewById(R.id.age);
text_name=(TextView) findViewById(R.id.name_edit);
text_age=(TextView) findViewById(R.id.name_age);
if (savedInstanceState!=null)
{
namer = savedInstanceState.get(SAVED_NAME);
name.setText(namer);
ager = savedInstanceState.get(SAVED_AGE);
age.setText(ager);
}
if (savedInstanceState==null)
{
Intent i=getIntent();
Bundle bundle=i.getExtras();
namer=bundle.getString("UName");
name.setText(namer);
ager=bundle.getString("UAge");
age.setText(ager);
}
}
#Override
protected void onSaveInstanceState(Bundle outState) {
outState.putString(savedName,namer);
outState.putString(savedAge,ager);
super.onSaveInstanceState(outState);
}
#Override
protected void onRestoreInstanceState(Bundle savedInstanceState) {
super.onRestoreInstanceState(savedInstanceState);
if (savedInstanceState!=null)
{
namer = savedInstanceState.get(SAVED_NAME);
name.setText(namer);
ager = savedInstanceState.get(SAVED_AGE);
age.setText(ager);
}
if (savedInstanceState==null)
{
Intent i=getIntent();
Bundle bundle=i.getExtras();
namer=bundle.getString("UName");
name.setText(namer);
ager=bundle.getString("UAge");
age.setText(ager);
}
}
}
I have parent fragment called OpFragment. From this fragment are inherited all fragments in my app.
public abstract class OpFragment extends Fragment {
private Loading loading;
public abstract int getLayoutId();
public abstract void getData();
public abstract void setListeners();
protected BackHandlerInterface backHandlerInterface;
public boolean onBackPressed(){
return false;
}
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setRetainInstance(true);
if(!(getActivity() instanceof BackHandlerInterface)) {
throw new ClassCastException("Hosting activity must implement BackHandlerInterface");
} else {
backHandlerInterface = (BackHandlerInterface) getActivity();
}
FragmentArgs.inject(this);
}
#Nullable
#Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
return inflater.inflate(getLayoutId(), container, false);
}
#Override
public void onViewCreated(View view, #Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
if(!isAdded()){
return;
}
getData();
setListeners();
}
protected String returnName() {
return null;
}
public void showTitle() {
EventBus.getDefault().post(new ShowName(returnName()));
}
#Override
public void onDestroyView() {
super.onDestroyView();
}
public Loading getLoading() {
if (this.loading == null) {
this.loading = new Loading(this.getActivity());
}
return this.loading;
}
/**
* Gets a component for dependency injection by its type.
*/
#SuppressWarnings("unchecked")
protected <C> C getComponent(Class<C> componentType) {
return componentType.cast(((HasComponent<C>) getActivity()).getComponent());
}
#Override
public void onStart() {
super.onStart();
backHandlerInterface.setSelectedFragment(this);
}
public interface BackHandlerInterface {
void setSelectedFragment(OpFragment backHandledFragment);
}
#Override
public void onResume() {
super.onResume();
sendGAScreens();
}
private void sendGAScreens() {
final Tracker tracker = OpApp.getDefaultTracker();
if(tracker != null) {
tracker.setScreenName(getClass().getSimpleName());
tracker.send(new HitBuilders.ScreenViewBuilder().build());
}
}
}
There are methods getData() and setListeners() inside onViewCreated.
I don't want to recall this methods after screen rotation. How can I do that ?
Simply checking savedInstanceState == null not gave me expected result.
override this method to detect screen rotation in your fragment and set some flag if its screen rotation. as shown below:
#Override
public void onConfigurationChanged(Configuration newConfig)
{
Log.d("tag", "config changed");
super.onConfigurationChanged(newConfig);
int orientation = newConfig.orientation;
if (orientation == Configuration.ORIENTATION_PORTRAIT || orientation == Configuration.ORIENTATION_LANDSCAPE)
flag= true;
....
}
and in your onViewCreated() do like this
if(!flag){
// call your functions
}
I'm experiencing an strange behavior of Fragment life-cycle each time that i rotate the screen. Only the first half of life-cycle methods are getting called, onPause,onSaveInstanceState,onStop, onDestroyView,onDestroy and onDetach. The other half (onAttach ...-onResume) are not getting called. The Activity associated with the Fragment is calling all its life-cycle methods.
Any help would be highly appreciated because I'm stuck on this issue.
Thanks in advance.
Here the entire code of the Activity and the static nested class where is the Fragment:
public class MoviesFeed extends AppCompatActivity {
private static boolean mTwoPane;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Log.d("ACT","onCreate");
setContentView(R.layout.themoviedb_main);
if(findViewById(R.id.detail_activity_container)!=null) {
//the detail_activity_container will be present only in large-screen
//Layouts (res/Layout-sw600dp. If this view is present, then the activity
//should be in two-pane mode
mTwoPane=true;
//In two-pane mode, show the detail view in this activity by adding
// or replacing the detail fragment using a fragment transaction
DetailActivityFragment detailActivityFragment=new DetailActivityFragment();
// Bundle bundle=new Bundle();
// bundle.putBoolean("twopane",mTwoPane);
// detailActivityFragment.setArguments(bundle);
if (savedInstanceState == null) {
getSupportFragmentManager().beginTransaction()
.add(R.id.detail_activity_container, detailActivityFragment)
.commit();
}
} else {
mTwoPane=false;
}
}
#Override
protected void onStart() {
Log.d("ACT","onStart");
super.onStart();
}
#Override
protected void onResume() {
Log.d("ACT","onResume");
super.onResume();
}
#Override
protected void onPause() {
Log.d("ACT","onPause");
super.onPause();
}
#Override
protected void onStop() {
Log.d("ACT","onStop");
super.onStop();
}
#Override
protected void onRestart() {
Log.d("ACT","onRestart");
super.onRestart();
}
#Override
protected void onDestroy() {
Log.d("ACT","onDestroy");
super.onDestroy();
}
#Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.movies_feed_main, menu);
return true;
}
#Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
startActivity(new Intent(this,SettingsActivity.class));
return true;
}
return super.onOptionsItemSelected(item);
}
public static class MoviesFeedFragment extends Fragment implements AdapterView.OnItemClickListener {
private static final int APPROX_FIXED_IMAGE_WIDTH=170;
private GridView mGridView;
private MovieAdapter mMovieAdapter;
private ArrayList<Response.Movie> mListMovies=new ArrayList<Response.Movie>();
private TimeMeasure mTm;
private boolean mFromDetailsActivity =false;
private boolean mUserRotation=false;
private boolean mFavoritesMode=false;
#Override
public void onAttach(Activity activity) {
Log.d("FRAG", "onAttach");
super.onAttach(activity);
}
#Override
public void onCreate(#Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Log.d("FRAG", "onCreate");
}
#Nullable
#Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view= inflater.inflate(R.layout.fragment_moviesfeed, container, false);
Log.d("FRAG", "onCreateView");
mGridView= (GridView) view.findViewById(R.id.gridView);
mGridView.setOnItemClickListener(this);
mMovieAdapter = new MovieAdapter(getActivity(), mListMovies);
mGridView.setAdapter(mMovieAdapter);
//for tablets specially
// float scalefactor = getResources().getDisplayMetrics().density * APPROX_FIXED_IMAGE_WIDTH;
// Point size=new Point();
// getWindowManager().getDefaultDisplay().getSize(size);
// int number=size.x;
// int columns = (int) ((float) number / (float) scalefactor);
//
// mGridView.setNumColumns(columns);
if(savedInstanceState!=null){
mUserRotation=true;
ArrayList<Response.Movie> tempList=new ArrayList<Response.Movie>();
tempList=savedInstanceState.getParcelableArrayList("mListMovies");
mListMovies.clear();
mListMovies.addAll(tempList);
mMovieAdapter = new MovieAdapter(getActivity(), mListMovies);
mGridView.setAdapter(mMovieAdapter);
}
return view;
}
#Override
public void onActivityCreated(#Nullable Bundle savedInstanceState) {
Log.d("FRAG", "onActivity");
super.onActivityCreated(savedInstanceState);
}
#Override
public void onPause() {
Log.d("FRAG", "onPause");
super.onPause();
}
#Override
public void onStop() {
Log.d("FRAG", "onStop");
super.onStop();
}
#Override
public void onSaveInstanceState(Bundle outState) {
Log.d("FRAG", "onSaveInstanceState");
super.onSaveInstanceState(outState);
outState.putParcelableArrayList("mListMovies", mListMovies);
}
#Override
public void onResume() {
Log.d("FRAG", "onResume");
super.onResume();
if (mFromDetailsActivity !=true && mUserRotation!=true) {
executeCallToMoviesApi();
} else if(mFromDetailsActivity==true && mFavoritesMode==true) {
getFavoritesMovies();
}
mFromDetailsActivity =false;
mUserRotation=false;
}
#Override
public void onDestroyView() {
Log.d("FRAG", "onDestroyView");
super.onDestroyView();
}
#Override
public void onDestroy() {
Log.d("FRAG", "onDestroy");
super.onDestroy();
}
#Override
public void onDetach() {
Log.d("FRAG", "onDetach");
super.onDetach();
}
#Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
if (mTwoPane==true) {
DetailActivityFragment detailActivityFragment=new DetailActivityFragment();
Bundle args=new Bundle();
args.putString("movieId", String.valueOf(mListMovies.get(position).getId()));
//Response.Movie movie=new Response.Movie();
//movie.setId(mListMovies.get(position).getId());
//args.putParcelable("movie",movie);
args.putBoolean("favoritesMode",mFavoritesMode);
detailActivityFragment.setArguments(args);
getActivity().getSupportFragmentManager().beginTransaction()
.replace(R.id.detail_activity_container,detailActivityFragment)
.commit();
} else {
Intent intent = new Intent(getActivity(), DetailActivity.class);
intent.putExtra("favoritesMode", mFavoritesMode);
intent.putExtra("movieId", mListMovies.get(position).getId());
mFromDetailsActivity = true;
startActivity(intent);
}
}
public void executeCallToMoviesApi(){
SharedPreferences sharedPreferences= PreferenceManager.getDefaultSharedPreferences(getActivity());
String orderStr= sharedPreferences.getString(getString(R.string.pref_order_key),
getString(R.string.pref_order_default));
mFavoritesMode=false;
if (orderStr.equals(getString(R.string.pref_popularity))){
getActivity().setTitle(getString(R.string.mainactivity_title_popularity));
getMoviesByPopularity();
}
if (orderStr.equals(getString(R.string.pref_rate))){
getActivity().setTitle(getString(R.string.mainactivity_title_rate));
getMoviesByRate();
}
if (orderStr.equals(getString(R.string.pref_favorites))) {
getActivity().setTitle(getString(R.string.mainactivity_title_favorites));
mFavoritesMode=true;
getFavoritesMovies();
}
}
public void getMoviesByPopularity(){
ApiClient.MyApi myApi=ApiClient.getMyApiClient();
myApi.getMoviesByPopularityDesc(AppConstants.API_KEY, callbackResponse());
}
public void getMoviesByRate(){
ApiClient.MyApi myApi=ApiClient.getMyApiClient();
myApi.getMoviesByAverageRate(AppConstants.API_KEY, callbackResponse());
}
private Callback<Response> callbackResponse() {
return new Callback<Response>() {
#Override
public void success(Response response, retrofit.client.Response response2) {
// Message.displayToast(MoviesFeed.this, "success");
mListMovies.clear();
mListMovies.addAll((ArrayList) response.getResults());
mMovieAdapter = new MovieAdapter(getActivity(), mListMovies);
mGridView.setAdapter(mMovieAdapter);
}
#Override
public void failure(RetrofitError error) {
Log.v("VILLANUEVA", "error:" + error.getMessage().toString());
Message.displayToast(getActivity(), "failure" + error.getMessage().toString());
}
};
}
public void getFavoritesMovies(){
List<MovieDetail> tempListDetail;
ArrayList<Response.Movie> tempList=new ArrayList<Response.Movie>();
SharedPreferenceManager sharedPreferenceManager=new SharedPreferenceManager(getActivity());
tempListDetail = sharedPreferenceManager.getFavoritesList();
Response.Movie tempMovie;
if (tempListDetail!=null) {
for (MovieDetail movieDetail : tempListDetail) {
tempMovie = new Response.Movie();
tempMovie.setId(movieDetail.getId());
tempMovie.setPoster_path(movieDetail.getPoster_path());
tempList.add(tempMovie);
}
mListMovies.clear();
mListMovies.addAll(tempList);
}
mMovieAdapter = new MovieAdapter(getActivity(), mListMovies);
mGridView.setAdapter(mMovieAdapter);
}
}//MoviesFeedFragment
Screenshots, before and after rotation.
Before:
After:
Log