Android: java.lang.NoSuchMethodError on FrameLayout$LayoutParams. -



Android: java.lang.NoSuchMethodError on FrameLayout$LayoutParams.<init> -

i getting "nosuchmethoderror" in code. have tried take help this link, couldn't help me.i providing code log output.hopefully these help people understand problem in code. please help me rid of it.

@suppresslint("newapi") @override protected void onsetcontentview() { this.mrendersurfaceview = new rendersurfaceview(this); this.mrendersurfaceview.setrenderer(this.mengine, this); final android.widget.framelayout.layoutparams surfaceviewlayoutparams =(layoutparams) ((viewgroup.marginlayoutparams)( new framelayout.layoutparams( super.createsurfaceviewlayoutparams()))); final framelayout.layoutparams framelayoutlayoutparams = (layoutparams) ((viewgroup.marginlayoutparams) (new framelayout.layoutparams(framelayout.layoutparams.match_parent, framelayout.layoutparams.match_parent))); // creating banner view. adview adview = new adview(this); adview.setadsize(adsize.smart_banner); adview.setadunitid(this.getresources().getstring(r.string.google_ad_id)); adview.loadad(new adrequest.builder().build()); final framelayout.layoutparams adviewlayoutparams = (layoutparams) ((viewgroup.marginlayoutparams) ( new framelayout.layoutparams( framelayout.layoutparams.wrap_content, framelayout.layoutparams.wrap_content, gravity.bottom | gravity.center_horizontal))); final framelayout framelayout = new framelayout(this); /*final framelayout.layoutparams framelayoutlayoutparams = new framelayout.layoutparams( framelayout.layoutparams.fill_parent, framelayout.layoutparams.fill_parent);*/ surfaceviewlayoutparams.setmargins(0, 0, 0, 50); framelayout.addview(this.mrendersurfaceview, surfaceviewlayoutparams); framelayout.addview(adview, adviewlayoutparams); this.setcontentview(framelayout, framelayoutlayoutparams); }

here logcat output

11-08 11:57:55.192: e/androidruntime(8442): fatal exception: main 11-08 11:57:55.192: e/androidruntime(8442):java.lang.nosuchmethoderror:android.widget.framelayout$layoutparams.<init> 11-08 11:57:55.192: e/androidruntime(8442):atcom.mcc.rattle.rattle2.onsetcontentview(rattle2.java:526) 11-08 11:57:55.192: e/androidruntime(8442):atorg.andengine.ui.activity.basegameactivity.oncreate(basegameactivity.java:85) 11-08 11:57:55.192: e/androidruntime(8442):atandroid.app.activity.performcreate(activity.java:5020) 11-08 11:57:55.192: e/androidruntime(8442):atandroid.app.instrumentation.callactivityoncreate(instrumentation.java:1080) 11-08 11:57:55.192: e/androidruntime(8442):atandroid.app.activitythread.performlaunchactivity(activitythread.java:2160) 11-08 11:57:55.192: e/androidruntime(8442):atandroid.app.activitythread.handlelaunchactivity(activitythread.java:2223) 11-08 11:57:55.192: e/androidruntime(8442):atandroid.app.activitythread.access$600(activitythread.java:149) 11-08 11:57:55.192: e/androidruntime(8442):atandroid.app.activitythread$h.handlemessage(activitythread.java:1309) 11-08 11:57:55.192: e/androidruntime(8442):atandroid.os.handler.dispatchmessage(handler.java:99) 11-08 11:57:55.192: e/androidruntime(8442):at android.os.looper.loop(looper.java:153) 11-08 11:57:55.192: e/androidruntime(8442):atandroid.app.activitythread.main(activitythread.java:5034) 11-08 11:57:55.192: e/androidruntime(8442):atjava.lang.reflect.method.invokenative(native method) 11-08 11:57:55.192: e/androidruntime(8442):atjava.lang.reflect.method.invoke(method.java:511) 11-08 11:57:55.192: e/androidruntime(8442):atcom.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:821) 11-08 11:57:55.192: e/androidruntime(8442):at com.android.internal.os.zygoteinit.main(zygoteinit.java:584) 11-08 11:57:55.192: e/androidruntime(8442):at dalvik.system.nativestart.main(native method)

the error pointing @ line

final framelayout.layoutparams framelayoutlayoutparams = (layoutparams) ((viewgroup.marginlayoutparams) (new framelayout.layoutparams(framelayout.layoutparams.match_parent, framelayout.layoutparams.match_parent)));

java android nosuchmethoderror

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -