I’m very new in Android and I’m bulding a MasterDetailFlow application the problem is that I can’t change the layout file (there is only the default TextView).
I want to add an ImageView and a MapView.
Please don’t forget that I’m a beginner 😀 !
Thanks.
public static final String ARG_ITEM_ID = "item_id";
DummyContent.DummyItem mItem;
public StationDetailFragment() {
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getArguments().containsKey(ARG_ITEM_ID)) {
mItem = DummyContent.ITEM_MAP.get(getArguments().getString(ARG_ITEM_ID));
}
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_station_detail, container, false);
if (mItem != null) {
((TextView) rootView.findViewById(R.id.station_detail)).setText(mItem.title);
}
return rootView;
}
The auto generated layout files will only contain a textview and you are therefor not able to add any new stull from the palette.
e.g
If you add any other Layout around the generated stub, you will be able to modify and add new stuff within that layout.xml
example: