In my app I have single activity and and all other fragments
I am setting background for activity from style.xml as below
<item name="android:windowBackground">@color/very_light_gray</item>
Now for only a perticular Fragment I want to set background transparent and I am not able to do that tried below code in Fragment did not work for me
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
// create ContextThemeWrapper from the original Activity Context with the custom theme
final Context contextThemeWrapper = new ContextThemeWrapper(getActivity(), R.style.yourCustomTheme);
// clone the inflater using the ContextThemeWrapper
LayoutInflater localInflater = inflater.cloneInContext(contextThemeWrapper);
// inflate the layout using the cloned inflater, not default inflater
return localInflater.inflate(R.layout.yourLayout, container, false);
}
Any idea how to do it?