android - No static method clearInterpolator in recyclerview -
i've tried insert item recyclerview
when use notifyiteminserted
animate it, face force close , messeage no static method clearinterpolator in recyclerview. don't know mean's. in advance help
here mainactivty
, adapter
, logcat
public class mainactivity extends appcompatactivity { drawerlayout mdrawerlayout; textview txtmemoryinfo; textview txtmemorypercent; textview txtmemoryunit; linearlayout layfreeablememoryinfo; recyclerview recyclerapplist; linearlayoutmanager layoutmanager; runningappadapter runningappadapter; appbarlayout appbar; int memfreeable; int oldprogvalue; public list<appinfo> result; public waveview wave; int countitems = 0; appcompatbutton btncompatremove; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); overridefonts(); setcontentview(r.layout.activity_main); inittoolbar(); setupviewandlisteners(); setprogressbarinfo(); itemanimator itemanimator = new defaultitemanimator(); itemanimator.setaddduration(1000); itemanimator.setremoveduration(1000); recyclerapplist.setitemanimator(itemanimator); runningappadapter = new runningappadapter(mainactivity.this); recyclerapplist.setadapter(runningappadapter); new loadappsrecyclerview().execute(); } private class loadappsrecyclerview extends asynctask<void, string, integer> { @override protected void onpreexecute() { super.onpreexecute(); } @override protected integer doinbackground(void... params) { int iscorrect= 0; getrunningappprocess getprocess = new getrunningappprocess(mainactivity.this); string launchername = getprocess.getlaunchername(); for(int count = 0; count < getprocess.runningappprocess.size(); count++) { final appinfo appinfo = new appinfo(); runningappprocessinfo processinfo = getprocess.runningappprocess.get(count); if (processinfo.importance == activitymanager.runningappprocessinfo.importance_foreground && processinfo.importancereasoncode == activitymanager.runningappprocessinfo.reason_unknown) { continue; } try { string apppackage = processinfo.processname; applicationinfo applicationinfo = getprocess.packagemanager.getapplicationinfo(apppackage.split(":")[0], 0); float totalmempss = getprocess.getmemtotalpss(processinfo); string appname = applicationinfo.loadlabel(getpackagemanager()).tostring(); if(applicationinfo.packagename.equals(launchername)){ continue; } appinfo.appname = appname; appinfo.apppackage = apppackage; appinfo.appmemused = string.valueof(totalmempss) + " mb"; result.add(appinfo); memfreeable += totalmempss; runonuithread(new runnable() { public void run() { /********** item inserted here */ runningappadapter.insertitem( appinfo); /************/ } }); countitems++; log.i("count", ""+countitems); publishprogress(string.valueof(memfreeable)); } catch (namenotfoundexception e) { } } //runningappadapter = new runningappadapter(result,mainactivity.this); return iscorrect; } @override protected void onpostexecute(integer args) { objectanimator.offloat(layfreeablememoryinfo, "rotationy", 0,180, 0).setduration(2000).start(); handler handler = new handler(); handler.postdelayed(new runnable() { @override public void run() { int mempercentfreealble = ((memfreeable) * 100)/1895; txtmemoryunit.settext("%"); txtmemorypercent.settext(string.valueof(mempercentfreealble)); } }, 2100); } @override protected void onprogressupdate(string... values) { super.onprogressupdate(values); int mempercentfreealble = (((integer.parseint(values[0])) * 200))/1895; for(int = oldprogvalue; < mempercentfreealble; i++){ wave.setprogress(i); txtmemorypercent.settext(values[0]); oldprogvalue = i; appbar.setbackgroundcolor(selectcolor.selectintcolor(mempercentfreealble)); } } }
adapter:
public class runningappadapter extends recyclerview.adapter<runningappadapter.contactviewholder> { private list<appinfo> applist; public static context contextmain; public static picasso mpicasso; private boolean[] itemchecks; public runningappadapter(list<appinfo> applist,context context) { this.applist = applist; runningappadapter.contextmain = context; picasso.builder builder = new picasso.builder(contextmain); builder.addrequesthandler(new appiconrequesthandler(contextmain)); itemchecks = new boolean [1000]; arrays.fill(itemchecks, true); mpicasso = builder.build(); } public runningappadapter(context context) { this.applist = new arraylist<appinfo>(); runningappadapter.contextmain = context; picasso.builder builder = new picasso.builder(contextmain); builder.addrequesthandler(new appiconrequesthandler(contextmain)); itemchecks = new boolean [1000]; arrays.fill(itemchecks, true); mpicasso = builder.build(); } @override public int getitemcount() { return applist.size(); } public void removefirstitems(int count) { (int i=0; i<count; i++) applist.remove(0); notifydatasetchanged(); } public void insertitem(appinfo object) { applist.add(object); notifyiteminserted(getitemcount() - 1); } @override public void onbindviewholder(contactviewholder appviewholder, final int position) { appinfo appinfo = applist.get(position); appviewholder.appname.settext(appinfo.appname); appviewholder.apppackage.settext(appinfo.apppackage); appviewholder.appmemused.settext(appinfo.appmemused); appviewholder.appmemused.setoncheckedchangelistener(null); appviewholder.appmemused.setchecked(itemchecks[position]); appviewholder.appmemused.setoncheckedchangelistener(new oncheckedchangelistener() { @override public void oncheckedchanged(compoundbutton buttonview, boolean ischecked) { itemchecks[position] = ischecked; } }); mpicasso.load(appiconrequesthandler.scheme_app_icon + ":" + appinfo.apppackage.split(":")[0]).placeholder(r.drawable.ic_launcher).into(appviewholder.appdrawable); } @override public contactviewholder oncreateviewholder(viewgroup viewgroup, int i) { view itemview = layoutinflater.from(viewgroup.getcontext()).inflate(r.layout.custom_item_app, viewgroup, false); contactviewholder app = new contactviewholder(itemview); return app; } public static class contactviewholder extends recyclerview.viewholder { protected textview appname; protected textview apppackage; protected imageview appdrawable; protected appcompatcheckbox appmemused; protected cardview item_card; public contactviewholder(view v) { super(v); contextmain = v.getcontext(); appname = (textview) v.findviewbyid(r.id.txtappname); apppackage = (textview) v.findviewbyid(r.id.txtapppackage); appdrawable = (imageview) v.findviewbyid(r.id.imgappicon); appmemused = (appcompatcheckbox) v.findviewbyid(r.id.chboxfree); item_card = (cardview) v.findviewbyid(r.id.card_view); v.setonclicklistener(new onclicklistener() { @override public void onclick(view view) { log.i("click", "element"+getlayoutposition() +"click." +appname.gettext().tostring()); boolean checkboxstate = !appmemused.ischecked(); appmemused.setchecked(checkboxstate); } }); } } }
logcat :
02-08 12:29:40.451: e/androidruntime(2138): fatal exception: main 02-08 12:29:40.451: e/androidruntime(2138): process: ir.androidnevisha.ramprogress, pid: 2138 02-08 12:29:40.451: e/androidruntime(2138): java.lang.nosuchmethoderror: no static method clearinterpolator(landroid/view/view;)v in class landroid/support/v4/animation/animatorcompathelper; or super classes (declaration of 'android.support.v4.animation.animatorcompathelper' appears in /data/app/ir.androidnevisha.ramprogress-1/base.apk) 02-08 12:29:40.451: e/androidruntime(2138): @ android.support.v7.widget.defaultitemanimator.resetanimation(defaultitemanimator.java:513) 02-08 12:29:40.451: e/androidruntime(2138): @ android.support.v7.widget.defaultitemanimator.animateadd(defaultitemanimator.java:216) 02-08 12:29:40.451: e/androidruntime(2138): @ android.support.v7.widget.simpleitemanimator.animateappearance(simpleitemanimator.java:105) 02-08 12:29:40.451: e/androidruntime(2138): @ android.support.v7.widget.recyclerview.animateappearance(recyclerview.java:3037) 02-08 12:29:40.451: e/androidruntime(2138): @ android.support.v7.widget.recyclerview.access$800(recyclerview.java:144) 02-08 12:29:40.451: e/androidruntime(2138): @ android.support.v7.widget.recyclerview$4.processappeared(recyclerview.java:421) 02-08 12:29:40.451: e/androidruntime(2138): @ android.support.v7.widget.viewinfostore.process(viewinfostore.java:213) 02-08 12:29:40.451: e/androidruntime(2138): @ android.support.v7.widget.recyclerview.dispatchlayout(recyclerview.java:2931) 02-08 12:29:40.451: e/androidruntime(2138): @ android.support.v7.widget.recyclerview.consumependingupdateoperations(recyclerview.java:1445) 02-08 12:29:40.451: e/androidruntime(2138): @ android.support.v7.widget.recyclerview.access$400(recyclerview.java:144) 02-08 12:29:40.451: e/androidruntime(2138): @ android.support.v7.widget.recyclerview$1.run(recyclerview.java:282) 02-08 12:29:40.451: e/androidruntime(2138): @ android.view.choreographer$callbackrecord.run(choreographer.java:767) 02-08 12:29:40.451: e/androidruntime(2138): @ android.view.choreographer.docallbacks(choreographer.java:580) 02-08 12:29:40.451: e/androidruntime(2138): @ android.view.choreographer.doframe(choreographer.java:549) 02-08 12:29:40.451: e/androidruntime(2138): @ android.view.choreographer$framedisplayeventreceiver.run(choreographer.java:753) 02-08 12:29:40.451: e/androidruntime(2138): @ android.os.handler.handlecallback(handler.java:739) 02-08 12:29:40.451: e/androidruntime(2138): @ android.os.handler.dispatchmessage(handler.java:95) 02-08 12:29:40.451: e/androidruntime(2138): @ android.os.looper.loop(looper.java:135) 02-08 12:29:40.451: e/androidruntime(2138): @ android.app.activitythread.main(activitythread.java:5254) 02-08 12:29:40.451: e/androidruntime(2138): @ java.lang.reflect.method.invoke(native method) 02-08 12:29:40.451: e/androidruntime(2138): @ java.lang.reflect.method.invoke(method.java:372) 02-08 12:29:40.451: e/androidruntime(2138): @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:903) 02-08 12:29:40.451: e/androidruntime(2138): @ com.android.internal.os.zygoteinit.main(zygoteinit.java:698)
i think should have written long time before introduced recycleriew. need update compatible package @ same time.
for example:
before
compile 'com.android.support:appcompat-v7:23.4.0'
now
compile 'com.android.support:recyclerview-v7:24.2.0' compile 'com.android.support:appcompat-v7:24.2.0'
note semicolon behind version number.
Comments
Post a Comment