• Register
0 votes
547 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.
7.5k points

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;
}
36.1k points

Related questions

1 vote
1 answer 259 views
259 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 186 views
186 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 813 views
813 views
Problem : I am learning Android Studio. I am trying to add implemntation 'com.google.android.material:material:1.0.0-alpha1' but if I try to build the project then my Android Studio gives below error: Program type already present: android.support.v4.app. ... .support.v4.app.INotificationSideChannel$Stub$Proxy, sources=[Unknown source file], tool name=Optional.of(D8)} How can I fix the above error?
asked Feb 19 mphil 2.3k points
1 vote
1 answer 44 views
44 views
Problem : I have recently started learning Android. If I try to execute my Android project on my Eclipse ADT then I often see below errors in my Console: [Dex Loader] Failed to load C:\Users\Martin\android-sdks\build-tools\26.0.0-preview\lib\dx.jar [ ... this case "C:\Users\Martin\android-sdks" is considered as the SDK folder. Kindly help me in fixing above strange looking Android error.
asked May 21 Martin K 6.6k points