Android App works in Debug Mode, but not in Run mode -
i have gone through similar questions asked before, scarce responses not helpful. using volley library populate json in recycler view. here logcat: referring other questions, have found failed set egl_swap_behavior on surface 0xb3ffe0e0, error=egl_success not problem.
here android studio project- https://github.com/sanke-t/legistify
i saw code on github.
jsonarrayrequest fetch = new jsonarrayrequest(request.method.get, url1.tostring(), null, new response.listener<jsonarray>() { @override public void onresponse(jsonarray response) { try { (int i=0;i<response.length();i++) { jsonobject random = response.getjsonobject(i); lawyer l=new lawyer(); l.setname(random.getstring("name")); l.setaddress(random.getstring("addr")); l.setphone(random.getstring("phonenum")); l.setfield(random.getstring("lawfield")); list.add(l); } } catch (exception e) { e.printstacktrace(); } } }, new response.errorlistener() { @override public void onerrorresponse(volleyerror error) { error.printstacktrace(); } }); queue.add(fetch); r=(recyclerview)findviewbyid(r.id.rv); r.setlayoutmanager(new linearlayoutmanager(this)); adapter=new adapter(getapplicationcontext(),list); r.setadapter(adapter);
have tried setting adapter listview inside onresponse() method inside jsonarrayrequest.
public void onresponse(jsonarray response) { try { (int i=0;i<response.length();i++) { jsonobject random = response.getjsonobject(i); lawyer l=new lawyer(); l.setname(random.getstring("name")); l.setaddress(random.getstring("addr")); l.setphone(random.getstring("phonenum")); l.setfield(random.getstring("lawfield")); list.add(l); } r=(recyclerview)findviewbyid(r.id.rv); r.setlayoutmanager(new linearlayoutmanager(this)); adapter=new adapter(getapplicationcontext(),list); r.setadapter(adapter); } catch (exception e) { e.printstacktrace(); } }
Comments
Post a Comment