Добрый день. Возникает ошибка - java.lang.RuntimeException: Firebase Database encountered an OutOfMemoryError. You may need to reduce the amount of data you are syncing to the client (e.g. by using queries or syncing a deeper path).
public class FragmentFireBaseMessageTreeView extends Fragment implements ChildEventListener{
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
iChildClickFireBaseFragment = (IChildClickFireBaseFragment)getFragmentManager().findFragmentById(R.id.contentMain);
View rootView = inflater.inflate(R.layout.fragment_firebase_message,container,false);
expandableListView = rootView.findViewById(R.id.exListView);
notificationsGroup = new LinkedHashMap<>();
notificationsGroup.put(WEB, notificationsListWeb);
notificationsGroup.put(ODIN_C, notificationsList1c);
notificationsGroup.put(MEscort, notificationsListMEscort);
adapter = new FireBaseMessageExpAdapter(getActivity(),notificationsGroup);
expandableListView.setAdapter(adapter);
databaseRef = FirebaseDatabase.getInstance().getReference().child("notifications");
region = App.getRegion(getActivity());
token = FirebaseInstanceId.getInstance().getToken();
code = App.get(getActivity()).getCodeAgent();
Query queryToAll = databaseRef.orderByChild("to").equalTo("/topics/all").limitToFirst(10);
Query queryToCity = databaseRef.orderByChild("to").equalTo("/topics/"+region).limitToFirst(10);
Query queryToCodeAndRegion = databaseRef.orderByChild("code").equalTo(region+"_"+code).limitToFirst(10);
queryToCodeAndRegion.addChildEventListener(this);
queryToAll.addChildEventListener(this);
queryToCity.addChildEventListener(this);
expandableListView.setOnChildClickListener(this);
dialog = new ProgressDialog(getActivity());
dialog.setMessage("Please wait...");
dialog.show();
return rootView;
}
@Override
public void onChildAdded(DataSnapshot dataSnapshot, String s) {
if (dataSnapshot.hasChildren()){
FireBaseNotification notification = dataSnapshot.getValue(FireBaseNotification.class);
addNotificationForAdapter(notification,dataSnapshot);
}
dialog.dismiss();
}
private void addNotificationForAdapter(FireBaseNotification notification,DataSnapshot dataSnapshot){
if (notification != null) {
notification.setId(dataSnapshot.getKey());
switch (notification.getTag()){
case WEB:
notificationsListWeb.add(notification);
notificationsGroup.put(WEB, notificationsListWeb);
break;
case ODIN_C:
notificationsList1c.add(notification);
notificationsGroup.put(ODIN_C, notificationsList1c);
break;
case MEscort:
notificationsListMEscort.add(notification);
notificationsGroup.put(MEscort, notificationsListMEscort);
break;
}
adapter.notifyDataSetChanged();
}
}
Собственно к этому всему добавлю что за этот месяц квота на скачивание превышена и предлагается перейти на платный тариф. Из-за этого может??