i add the view to the rootview
in that way
private RelativeLayout addThisView;
private View rootView;
LayoutInflater inflater = LayoutInflater.from(mContext);
addThisView = (RelativeLayout) inflater.inflate(R.layout.loading_temp_cover, null, false);
if(rootView instanceof FrameLayout){
((FrameLayout)rootView).addView(addThisView);
}
trying to remove view from root view
/* remove view from the root view start */
rootView = ((Activity) mContext).getWindow().getDecorView().findViewById(android.R.id.content);
RelativeLayout loadingTempCoverRelative =(RelativeLayout) rootView.findViewById(R.id.loadingTempCoverRelative);
if(loadingTempCoverRelative!=null){
if(rootView instanceof FrameLayout){
((FrameLayout)rootView).removeView(loadingTempCoverRelative);
}
}
/* remove view from the root view end */
and then when i check the loadingTempCover
is exist (below codes). it is still exist..
i debugged and see; when reach and complete the removeView()
function it doesn't effect anything. still i can see the loadingTempCover
layout in rootview
. i couldn't understand where am i doing wrong..
rootView = ((Activity)mContext).getWindow().getDecorView().findViewById(android.R.id.content);
RelativeLayout loadingTempCoverRelative =(RelativeLayout) rootView.findViewById(R.id.loadingTempCoverRelative);
if(loadingTempCoverRelative!=null){
loadingTempCoverRelative.setVisibility(loadingTempCoverRelative.getVisibility() == View.VISIBLE ? View.GONE : View.VISIBLE);
return;
}