When I run my app in console I've got this error:
To much output to process
static void* NetworkCommunication::ReadThreadProc(void*) -- 477: epoll_wait() unexpected error: Invalid argument
and
I/Choreographer: Skipped 58 frames! The application may be doing too much work on its main thread.
I have a Project.class and 4 activities which use this class as a model class. 3 classes work perfectly but one (the same but other names of strings) is crashing and come back to MainActivity. One day worked correctly but this day is crashed. Only when is connected to Firebase. When my app is offline nothing shows, so it works.
Project.class:
public String title;
public String place;
public String date;
public Project(){
}
public Project(String title, String place, String date ){
this.title = title;
this.place = place;
this.date = date;
}
public String getTitle() {
return title;
}
public String getPlace() {
return place;
}
public String getDate() {
return date;
}
}
Activity:
private Adapter adapter;
private ListView listView;
private DatabaseReference reference;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity);
listView = (ListView) findViewById(R.id.list);
adapter = new Adapter(this, R.id.list);
listView.setAdapter(adapter);
FirebaseDatabase database = FirebaseDatabase.getInstance();
reference = database.getReference("database");
reference.addChildEventListener(new com.google.firebase.database.ChildEventListener() {
@Override
public void onChildAdded(com.google.firebase.database.DataSnapshot dataSnapshot, String s) {
Project msg = dataSnapshot.getValue(Project.class);
adapter.add(msg);
adapter.notifyDataSetChanged();
}
@Override
public void onChildChanged(com.google.firebase.database.DataSnapshot dataSnapshot, String s) {
}
@Override
public void onChildRemoved(com.google.firebase.database.DataSnapshot dataSnapshot) {
}
@Override
public void onChildMoved(com.google.firebase.database.DataSnapshot dataSnapshot, String s) {
}
@Override
public void onCancelled(DatabaseError databaseError) {
}
});
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Project selectedList = adapter.getItem(position);
if (selectedList != null) {
Intent intent = new Intent(Activity.this, Details_Project_Activity.class);
intent.putExtra(Constants.KEY_LIST_TITLE, selectedList.getTitle());
intent.putExtra(Constants.KEY_LIST_PLACE, selectedList.getPlace());
intent.putExtra(Constants.KEY_LIST_DATE, selectedList.getDate());
startActivity(intent);
}
}
});
}
I have Activity2 and Activity3 also the same with changed particular names of variables and database name and it works. Only in this class it doesn't work. In database names are the same. So, it should work.
It this error, at the beggining, can cause this problem? Could somebody help me to resolve this situation?