• Register
0 votes
1.6k views

Problem :

I am new to java, I am trying to display this feed in Custom list view but when I am trying to do so I am getting the following error

 "Attempted to finish an input event but the input event receiver has already been disposed"

The above error is in logcat and nothing happens in app after that,i have an adpter class as follows:

public class MyUserAdapter extends ArrayAdapter<UserData>{

private Context context;

private List<UserData> users_list;

public MyUserAdapter(Context context, int resource,List<UserData> objects) {

super(context, resource);

this.context= context;

this.users_list= objects;

 }

@Override

public View getView(int position, View convertView, ViewGroup parent) {

LayoutInflater inflater= (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);

View customview= inflater.inflate(R.layout.item_user, parent, false);

UserData userData=  users_list.get(position);

TextView tv = (TextView) customview.findViewById(R.id.textview1);

tv.setText(userData.getName());

return customview;

 }

}

 

LogCat:

hilz.myapplication W/EGL_emulation: eglSurfaceAttrib not implemented
hilz.myapplication W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xa50c8260, error=EGL_SUCCESS
hilz.myapplication W/InputEventReceiver: Attempted to finish an input event but the input event receiver has already been disposed.
6 5 3
7,540 points

Please log in or register to answer this question.

1 Answer

0 votes

Solution :

In your Public MyUserAdapter function, your super is not passing in the Objects.

It should be as follows:

public MyUserAdapter(Context context, int resource,List<UserData> objects)
{
super(context, resource, objects);
this.context= context;
this.users_list= objects;
}

and not like below:

public MyUserAdapter(Context context, int resource,List<UserData> objects)
{
super(context, resource);
this.context= context;
this.users_list= objects;
}
9 7 4
38,600 points

Related questions

1 vote
1 answer 640 views
640 views
Problem : When I call a blank layout and afterwards call my layout it gives me the following error: the specified child already has a parent. you must call removeview() on the child's parent first.
asked Nov 11, 2019 peterlaw 6.9k points
0 votes
1 answer 6 views
6 views
Problem: this activity already has an action bar supplied by the window decor and Trying to move over my stuff to use Toolbar instead of action bar but I keep getting an error.
asked Feb 13 Shovo210 3.1k points
0 votes
1 answer 77 views
0 votes
1 answer 13 views
13 views
Problem: I google the error message getOutputStream() has already been called for this response and many people said it is because of the space or newline after <% or %>, but in my code , there is no a space or a newline. I am using tomcat6 on linux.
asked Feb 18 Ali 5.1k points
0 votes
1 answer 12 views
12 views
Solve this problem. I am new.
asked Dec 28, 2020 TeamScript 13.5k points
0 votes
1 answer 468 views
468 views
Problem : I got following exception from my servlet: java.lang.illegalstateexception: response has already been committed
asked Oct 31, 2019 peterlaw 6.9k points
0 votes
1 answer 9 views
9 views
Problem: frontcontroller::init - cart cannot be loaded or an order has already been placed using this cart
asked 6 days ago Muneeb Saadii 2.4k points