android - Inflate view in a single fragment -
I currently have an action bar with 5 tabs (pieces) in the developed app, one of these pieces shows a warning dialogue , But the layout is empty. I want to have a background image, so I created a layout for that piece and used the inflater.inflate (...) method to set the layout.
The problem is that the line of code sets the layout to all pieces of pieces. Which limitation can I limit it to? This is my code:
extends the public class migration agreement fragment {Creatives on the public view (Layout: Influencer Inflator, View Group Container, Bundle Saved InstantState) {// ... AlertDialog Ad = New alertDeal. GetActivity) .setTitle ("title") // ... ad.show (); Inflater.inflate (R. Late fragment_m, container); // This is the layout that I want to increase for the return of my piece. Conrite Viz (Inflator, Container, Saved Instantstate); }
Also tried to replace the last two rows with:
returnBut I'm getting this error:
07-27 16:19: 46.768: E / Android time (1998): java. Lang.IllegalStateException: The specified child already has a parent. You must first call the removeView () on the child's parent
Answer:
return inflater.inflate (R.layout.fragment_trovami, container, incorrect);
Comments
Post a Comment