Hi,
I wanted to use fragmentation in my application. Here is the
scenario.
There are 2 vertical fragments. The 1st fragment have buttons and
second fragment have screens that need to be displayed according to
the button pressed in the 1st fragment.
I have implemented this using the help of the android sample
examples .

But now, in the 2nd fragment as well there are buttons which on
clicking, we need to navigate in this fragment from one activity(xml)
to another(xml) within the 2nd fragment. That is the 1st fragment is
always visible to the user. I have multiple xmls which need to be
navigated from one screen to another on click of buttons. But these
screens needs to be there only in the 2nd fragment as the 1st fragment
should always show same buttons from the beginning.



This is my code of my 2nd fragment class. Here the entire screen is
occupied by the activity when i click on the button.
public static class DetailsFragment extends Fragment {

public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState)
 {
View v = (View) inflater.inflate(R.layout.testscreen, null);
Button b = (Button)v.findViewById(R.id.button1);

b.setOnClickListener(new OnClickListener()
      {

                @Override
                public void onClick(View v) {
                displayNextScreen();
        }
                        });

return v;

}

private void displayNextScreen()
{
          Intent intent = new
Intent(getActivity(),NextActivity.class);
         startActivity(intent);
}

}

Please help..

Thanks,
Priyank

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to