Android: Adding a fragment to an activity

后端 未结 2 1181
一向
一向 2020-12-16 05:31

I\'m fairly new to Android, so this might have an obvious answer, but I can\'t seem to find it.

I\'m writing a version of a calculator app. I want to make it so tha

2条回答
  •  粉色の甜心
    2020-12-16 05:34

    use easy code in your activity

    getSupportFragmentManager().beginTransaction().add(R.id.yourcontainer,new yourfragment).commit();
    

提交回复
热议问题