Refer on this link, I try to make 1 activity for many layout, but I've got a problem on how to implementing if else condition in my activity.
This is slice of my code :
TabRouting.java
public class TabRouting extends Fragment {
.................
@Override
public boolean onChildClick(ExpandableListView parent, View v,
int groupPosition, int childPosition, long id) {
if (groupPosition == 0){
if (childPosition == 0){
Intent a = new Intent(getActivity(), Content.class);
startActivity(a);
}
if (childPosition == 1){
Intent a = new Intent(getActivity(), Content.class);
startActivity(a);
}
if (childPosition == 2){
Intent a = new Intent(getActivity(), Content.class);
startActivity(a);
}
if (childPosition == 3){
Intent a = new Intent(getActivity(), Content.class);
startActivity(a);
}
}
................
return false;
}
});
...............
return v;
}
I want to make 1 activity (Content.java) to have many layout, so every I click on every child item of ExpandableListView I can see different layout.
Thanks :)