Start FragmentTransaction from within ArrayAdapter

前端 未结 3 1549
感情败类
感情败类 2020-12-30 13:44

I have a ListView with several rows. Each row has a button.

I want the button to start a FragmentTransaction to replace the Fragment that

3条回答
  •  滥情空心
    2020-12-30 14:30

    First get the context in your Constructor and then try following code,

    FragmentTransaction ft = ((FragmentActivity)context).getSupportFragmentManager().beginTransaction();
    

提交回复
热议问题