I have a fragment layout and left sidemenu (drawer menu). It works fine, but I want to make my fragment show different layouts like a wizard. I wasn't able to do that.
public class TheWizard extends Fragment{
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.wizardstep1, container, false);
This way, I'm able to show first layout, now when I try to do:
Button button= (Button) v.findViewById(R.id.button1);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
View vstep2 = inflater.inflate(R.layout.wizardstep2, null, false);
It doesn't work. I want my fragment to show multiple layout and each layout will have different checkboxes and textboxes. It's a step-by-step wizard, but I want it to be fragment and I want to keep left drawer menu staying there whole time. Any ideas?
I even tried to set inflate
and container
variables as public variables, so I can use in onClick function, but still no luck.