• Register
0 votes
2k 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 12 views
12 views
Problem : What am I doing wrong > Attempted to access a cursor after it has been closed.
asked Apr 23 Abik Dey 4k points
1 vote
1 answer 935 views
935 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 20 views
20 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 Sabbir Hossain 14.6k points
0 votes
1 answer 8 views
8 views
Problem: Is there someone who can assist me in resolving this issue &ldquo;If an exception has already been thrown, what will the interpreter read next in the program&rdquo;?
asked Apr 1 rakib1 51.5k points
0 votes
1 answer 61 views
61 views
Problem : I have my web application which is throwing the below error while running in IE: &ldquo;Illegal operation attempted on a registry key that has been marked for deletion&rdquo; It works really fine in my Chrome but unfortunately gives the above error in production ... information on my error. And it confuses me as why this is only occurring when trying to use the IE. Any pointers?
asked Jan 6, 2020 alecxe 7.5k points
1 vote
1 answer 4 views
4 views
Problem: I am using Linux and faced this error: Getoutputstream() has already been called for this response.
asked Apr 26 PkGuy 23.5k points
0 votes
1 answer 3 views
3 views
Problem: how can i check if a char variable is empty? I mean that check with like empty() method with strings, if the string doesn't contain any character stringVar.empty() will result true. How can i check if a char variable doesn't contain a character? For example, I' ... BOM: No, files i tested didn't throw me errors apart that the algorithm is a little bugged, but not the part i asked to you.
asked Apr 26 Moumita Bhowmick 12.4k points
0 votes
1 answer 6 views
6 views
Question: 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. How can I resolve it?
asked Apr 18 munim01 21k points
0 votes
1 answer 5 views
5 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. ... JspServlet.serviceJspFile(JspServlet.java:342) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267) javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
asked Apr 10 Atik03 26.5k points