android - Error inflating class set in xml -
i'm trying create textview
slides screen , creates error, don't know why. xml:
<set xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="fill_parent" android:layout_height="fill_parent" android:fillafter="true"> <scale android:duration="500" android:fromxscale="1.0" android:fromyscale="1.0" android:interpolator="@android:anim/linear_interpolator" android:toxscale="1.0" android:toyscale="0.0" /> <textview android:id="@+id/scroll_message" android:text="@string/scroll_text" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_gravity="center" android:minlines="1" android:maxlines="10" android:width="250dp" android:textcolor="@android:color/black" android:textstyle="bold" /> </set>
and activty class:
package com.example.rsa.myapplication; import android.app.activity; import android.os.bundle; import android.text.method.scrollingmovementmethod; import android.view.menu; import android.view.menuitem; import android.view.view; import android.content.intent; import android.widget.edittext; import android.widget.textview; import android.widget.scrollview; public class myactivity extends activity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_my); //textview txt = (textview) findviewbyid(r.id.scroll_message); } @override public boolean oncreateoptionsmenu(menu menu) { getmenuinflater().inflate(r.menu.activity_my, menu); return true; } }
the error given is:
09-10 09:02:47.117 31292-31292/com.example.rsa.myapplication e/androidruntime﹕ fatal exception: main process: com.example.rsa.myapplication, pid: 31292 java.lang.runtimeexception: unable start activity componentinfo{com.example.rsa.myapplication/com.example.rsa.myapplication.myactivity}: android.view.inflateexception: binary xml file line #1: error inflating class set @ android.app.activitythread.performlaunchactivity(activitythread.java:2255) @ android.app.activitythread.handlelaunchactivity(activitythread.java:2317) @ android.app.activitythread.access$800(activitythread.java:143) @ android.app.activitythread$h.handlemessage(activitythread.java:1258) @ android.os.handler.dispatchmessage(handler.java:102) @ android.os.looper.loop(looper.java:135) @ android.app.activitythread.main(activitythread.java:5070) @ java.lang.reflect.method.invoke(native method) @ java.lang.reflect.method.invoke(method.java:372) @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:836) @ com.android.internal.os.zygoteinit.main(zygoteinit.java:631) caused by: android.view.inflateexception: binary xml file line #1: error inflating class set @ android.view.layoutinflater.createviewfromtag(layoutinflater.java:753) @ android.view.layoutinflater.inflate(layoutinflater.java:478) @ android.view.layoutinflater.inflate(layoutinflater.java:410) @ android.view.layoutinflater.inflate(layoutinflater.java:361) @ com.android.internal.policy.impl.phonewindow.setcontentview(phonewindow.java:350) @ android.app.activity.setcontentview(activity.java:2122) @ com.example.ranjeev.myapplication.myactivity.oncreate(myactivity.java:23) @ android.app.activity.performcreate(activity.java:5720) @ android.app.instrumentation.callactivityoncreate(instrumentation.java:1102) @ android.app.activitythread.performlaunchactivity(activitythread.java:2208)
what cause error?
use animation set in code, that:
public void onresume(){ super.onresume(); textview.startanimation(animationutils.loadanimation(getactivity(), r.anim.slide_up)); }
Comments
Post a Comment