how to move from one fragment to another fragment on button click

前端 未结 6 1900
失恋的感觉
失恋的感觉 2021-01-16 11:43

I am using the SherlockFragments library for the sliding menu.I have list of items as menu when I click on item fragment get opened as an activity but it is a fragment.Now

6条回答
  •  时光说笑
    2021-01-16 11:55

    You can try this also:-

    public void ButtonClick(View view) {
      Fragment mFragment = new YourNextFragment(); 
     getSupportFragmentManager().beginTransaction()
                .replace(R.id.content_frame, mFragment ).commit();
     }
    

提交回复
热议问题