我有一个片段,它将自己加载所有数据。所以我在其中创建了一个Asynctask扩展类和一个Comparator扩展类来对AsyncTask检索数据进行排序。这是代码:
public class FragmentWidgetDrawer extends Fragment {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//some code...
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
//some code...
return view;
}
private final class WidgetsLoadTask extends AsyncTask<Void, Void, Void>{
@Override
protected Void doInBackground(Void... voids) {
//some code...
return null;
}
}
public static class WidgetAndShortcutNameComparator implements Comparator<Object> {
WidgetAndShortcutNameComparator(PackageManager pm) {
//ctor
}
public final int compare(Object a, Object b) {
//some code...
return mCollator.compare(labelA, labelB);
}
};
那么,添加这些类会增加片段在我实例化时所需的内存大小吗?