我必须从这个类调用片段,并且还想在片段中发送Array列表 我在arraylist中存储firebase通知
public class DataManager{
private static volatile DataManager dataManager;
public DataManager() {
}
public static DataManager factory() {
if (dataManager == null) {
synchronized (DataManager.class) {
if (dataManager == null) {
dataManager = new DataManager();
}
}
dataManager = new DataManager();
}
return dataManager;
}
public ArrayList<NotIfModel> notIfArray = new ArrayList<>();
}
答案 0 :(得分:0)
试试这个:
public DataManager(FragmentManager fragmentManager) {
Fragment fragment = new DetailFragment();
fragmentManager.popBackStack(null, FragmentManager.POP_BACK_STACK_INCLUSIVE);
fragmentManager.beginTransaction().add(android.R.id.content, fragment).commit();
}