Android: enable copy in Textview -
i have linearlayout
lot of textviews, need enable copy clipboard. need copy layout don't know how??
i tried use android:textisselectable
. in textview
getting error message:
01-06 16:58:18.976: d/androidruntime(2991): shutting down vm 01-06 16:58:18.976: w/dalvikvm(2991): threadid=1: thread exiting uncaught exception (group=0x2b542210) 01-06 16:58:18.986: e/androidruntime(2991): fatal exception: main 01-06 16:58:18.986: e/androidruntime(2991): java.lang.runtimeexception: unable start activity componentinfo{com.quraan.tajweed/com.quraan.tajweed.esti3azah}: android.view.inflateexception: binary xml file line #34: error inflating class <unknown> 01-06 16:58:18.986: e/androidruntime(2991): @ android.app.activitythread.performlaunchactivity(activitythread.java:1967) 01-06 16:58:18.986: e/androidruntime(2991): @ android.app.activitythread.handlelaunchactivity(activitythread.java:1992) 01-06 16:58:18.986: e/androidruntime(2991): @ android.app.activitythread.access$600(activitythread.java:127) 01-06 16:58:18.986: e/androidruntime(2991): @ android.app.activitythread$h.handlemessage(activitythread.java:1158) 01-06 16:58:18.986: e/androidruntime(2991): @ android.os.handler.dispatchmessage(handler.java:99) 01-06 16:58:18.986: e/androidruntime(2991): @ android.os.looper.loop(looper.java:137) 01-06 16:58:18.986: e/androidruntime(2991): @ android.app.activitythread.main(activitythread.java:4441) 01-06 16:58:18.986: e/androidruntime(2991): @ java.lang.reflect.method.invokenative(native method) 01-06 16:58:18.986: e/androidruntime(2991): @ java.lang.reflect.method.invoke(method.java:511) 01-06 16:58:18.986: e/androidruntime(2991): @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:784) 01-06 16:58:18.986: e/androidruntime(2991): @ com.android.internal.os.zygoteinit.main(zygoteinit.java:551) 01-06 16:58:18.986: e/androidruntime(2991): @ dalvik.system.nativestart.main(native method) 01-06 16:58:18.986: e/androidruntime(2991): caused by: android.view.inflateexception: binary xml file line #34: error inflating class <unknown> 01-06 16:58:18.986: e/androidruntime(2991): @ android.view.layoutinflater.createview(layoutinflater.java:606) 01-06 16:58:18.986: e/androidruntime(2991): @ android.view.layoutinflater.createviewfromtag(layoutinflater.java:680) 01-06 16:58:18.986: e/androidruntime(2991): @ android.view.layoutinflater.rinflate(layoutinflater.java:739) 01-06 16:58:18.986: e/androidruntime(2991): @ android.view.layoutinflater.rinflate(layoutinflater.java:742) 01-06 16:58:18.986: e/androidruntime(2991): @ android.view.layoutinflater.rinflate(layoutinflater.java:742) 01-06 16:58:18.986: e/androidruntime(2991): @ android.view.layoutinflater.inflate(layoutinflater.java:489) 01-06 16:58:18.986: e/androidruntime(2991): @ android.view.layoutinflater.inflate(layoutinflater.java:396) 01-06 16:58:18.986: e/androidruntime(2991): @ android.view.layoutinflater.inflate(layoutinflater.java:352) 01-06 16:58:18.986: e/androidruntime(2991): @ com.android.internal.policy.impl.phonewindow.setcontentview(phonewindow.java:270) 01-06 16:58:18.986: e/androidruntime(2991): @ android.app.activity.setcontentview(activity.java:1835) 01-06 16:58:18.986: e/androidruntime(2991): @ com.quraan.tajweed.esti3azah.oncreate(esti3azah.java:37) 01-06 16:58:18.986: e/androidruntime(2991): @ android.app.activity.performcreate(activity.java:4465) 01-06 16:58:18.986: e/androidruntime(2991): @ android.app.instrumentation.callactivityoncreate(instrumentation.java:1049) 01-06 16:58:18.986: e/androidruntime(2991): @ android.app.activitythread.performlaunchactivity(activitythread.java:1931) 01-06 16:58:18.986: e/androidruntime(2991): ... 11 more 01-06 16:58:18.986: e/androidruntime(2991): caused by: java.lang.reflect.invocationtargetexception 01-06 16:58:18.986: e/androidruntime(2991): @ java.lang.reflect.constructor.constructnative(native method) 01-06 16:58:18.986: e/androidruntime(2991): @ java.lang.reflect.constructor.newinstance(constructor.java:417) 01-06 16:58:18.986: e/androidruntime(2991): @ android.view.layoutinflater.createview(layoutinflater.java:586) 01-06 16:58:18.986: e/androidruntime(2991): ... 24 more 01-06 16:58:18.986: e/androidruntime(2991): caused by: java.lang.classcastexception: android.text.spannablestring cannot cast java.lang.string 01-06 16:58:18.986: e/androidruntime(2991): @ com.quraan.tajweed.simpletextview.<init>(simpletextview.java:54) 01-06 16:58:18.986: e/androidruntime(2991): ... 27 more 01-06 16:58:19.076: d/dalvikvm(2991): gc_concurrent freed 233k, 4% free 9270k/9607k, paused 2ms+2ms
at line 54 of file simpletextview.java casting spannablestring simple string.
if inside spannablestring
there string can use .tostring()
method instead of cast.
Comments
Post a Comment