有什么方法可以在'android.support.v4.app.Fragment'片段中使用replace()方法吗?
答案 0 :(得分:1)
只需使用getFragmentManager()
代替Fragment fragment = new Fragment();
FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
fragmentTransaction.replace(fragment, "Fragment_tag").commit();
例如
using SomeProject.LayerB;
namespace SomeProject.LayerA;
{
public class AppService
{
private readonly ISomeRepository someRepository;
public LocationManagementService(ISomeRepository someRepository)
{
this.someRepository = someRepository;
}
// other codes ...
}
}