SlidingMenu icon indicating copy to clipboard operation
SlidingMenu copied to clipboard

change content frame.

Open li9ht opened this issue 14 years ago • 3 comments

i wanted to change the content_frame with new content. keep getting no viewfound for id ....

my samplelistframgment.java onclick

    public void onListItemClick(ListView l, View v, int position, long id) {



        MainActivity parent = (MainActivity) getActivity();
        parent.getSupportFragmentManager()
        .beginTransaction()
        .replace(R.id.content_frame, new Setting()) //NewFragment is what I wanted to replace on the front menu
        .commit();
        parent.toggle();



        /*Toast.makeText( getActivity(), Integer.toString(position) + " okwww ", Toast.LENGTH_SHORT).show();
*/
    }

setting.java


public class Setting extends Fragment {

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        return inflater.inflate(R.layout.setting, null);
    }

}

am i doing this right.. any example on changing the contect_frame

li9ht avatar Sep 27 '12 09:09 li9ht

Hi! I'd like to help you if the problem still persist. Can you provide more details? What is your layout for an activity? I did the same inside example project and it works fine:

     @Override
    public void onListItemClick(ListView l, View v, int position, long id)
    {
        getActivity().getSupportFragmentManager()
                                .beginTransaction()
                .replace(R.id.content_frame, new Settings())
                .commit();
        ((BaseActivity) getActivity()).toggle();
    }

AtatakaiNeko avatar Oct 10 '12 07:10 AtatakaiNeko

hi. sorry for the late reply.. i tried implementing your suggestion .. i Failed. i don't have proper example to base upon. Do you have a proper example for implementing slidingMenu which the menu is on the left side of the app. And with proper onlistitemclick action . btw i keep getting No view found for id 0x7f050036 for fragment Setting

li9ht avatar Oct 11 '12 04:10 li9ht

Check the new example app. There are 2 examples of this behavior.

jfeinstein10 avatar Oct 29 '12 13:10 jfeinstein10