Side menu not working after changing fragment view

I'm coding a dynamic fragment view with a side panel menu, that download in asynctask content. In this asynctask I create new element that I put in the view of my fragment. So for updating the view I take the rootView of my fragment, change it, delete the older from the parents and put the new.

protected void onPostExecute(String result) { View rootView = context.getRootView(); // here I work on the rootView // context type is MainActivity.ProductFragment ((ViewGroup) rootView.getParent()).removeView(rootView); context.getActivity().setContentView(rootView); }

So my fragment view is up to date after the asyntask is done but my side menu doesn't show up (that work before the downloading task).

This is my problem :'(, thanks to you and sorry my bad english.

EDIT: FIXED, using:

ViewGroup viewGroup = ((ViewGroup) rootView.getParent()); viewGroup.removeView(rootView); viewGroup.addView(rootView);

Category:android Views:4 Time:2018-04-10

Related post

Copyright (C) dskims.com, All Rights Reserved.

processed in 0.469 (s). 11 q(s)