Mam duży problem z moją aplikacją. To się zawiesza i nie wiem dlaczego.crash - material design android 5.0
W mojej aplikacji mam Activity
z listview
i customlistviewadapter
i drugą Detailactivity
. Chcę dodać projekt materiału z Androida Lollipop i jest mój problem. Dodałem dobrą transakcję aktywności między dwoma Activities
.
Zabieram obraz i tytuł z listviewelement wyjście z ListView i za pomocą SparseArray<Bitmap>
przenieść Obraz, intent
i ActivityOptions
przenieść resztę moich danych.
Transakcja z mojej pierwszej Activity
na DetailActivity
działa poprawnie. Na moim DetailActivity
muszę załadować więcej danych, jednym z nich jest opis. Tekst opisu zawiera \ n znaczników dla nowego wiersza, a czasem także znaczników xhtml. Aby pozbyć się \ n znaczników, używam String mdesc = text.replace("\n", "<br />");
.
Tak więc teraz mam tylko znaczniki xhtml i aby wyglądał ładnie w moim widoku tekstowym, używam tej linii description.setText(Html.fromHtml(mdesc));
.
Działa również jak urok, ale jeśli kliknę przycisk Wstecz, aplikacja ulega awarii, gdy liczba znaków w opisie jest wyższa niż ~ 3800.
To mój logcat:
A/art﹕ art/runtime/check_jni.cc:65] JNI DETECTED ERROR IN APPLICATION: JNI CallVoidMethodV called with pending exception 'java.lang.IllegalStateException' thrown in void android.os.MessageQueue.nativePollOnce(long, i
A/art﹕ art/runtime/check_jni.cc:65] in call to CallVoidMethodV
A/art﹕ art/runtime/check_jni.cc:65] from void android.os.MessageQueue.nativePollOnce(long, int)
A/art﹕ art/runtime/check_jni.cc:65] "main" prio=5 tid=1 Runnable
A/art﹕ art/runtime/check_jni.cc:65] | group="main" sCount=0 dsCount=0 obj=0x737d5ec0 self=0xb5007800
A/art﹕ art/runtime/check_jni.cc:65] | sysTid=31960 nice=-6 cgrp=apps sched=0/0 handle=0xb6f40ec8
A/art﹕ art/runtime/check_jni.cc:65] | state=R schedstat=(285569518384 174632061067 1598010) utm=17211 stm=11345 core=0 HZ=100
A/art﹕ art/runtime/check_jni.cc:65] | stack=0xbe3ad000-0xbe3af000 stackSize=8MB
A/art﹕ art/runtime/check_jni.cc:65] | held mutexes= "mutator lock"(shared held)
A/art﹕ art/runtime/check_jni.cc:65] native: #00 pc 00004c58 /system/lib/libbacktrace_libc++.so (UnwindCurrent::Unwind(unsigned int, ucontext*)+23)
A/art﹕ art/runtime/check_jni.cc:65] native: #01 pc 000034c1 /system/lib/libbacktrace_libc++.so (Backtrace::Unwind(unsigned int, ucontext*)+8)
A/art﹕ art/runtime/check_jni.cc:65] native: #02 pc 0025918d /system/lib/libart.so (art::DumpNativeStack(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, int, char const*, art::mirror::ArtMethod*)+84)
A/art﹕ art/runtime/check_jni.cc:65] native: #03 pc 0023cd13 /system/lib/libart.so (art::Thread::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const+162)
A/art﹕ art/runtime/check_jni.cc:65] native: #04 pc 000b1195 /system/lib/libart.so (art::JniAbort(char const*, char const*)+620)
A/art﹕ art/runtime/check_jni.cc:65] native: #05 pc 000b18c5 /system/lib/libart.so (art::JniAbortF(char const*, char const*, ...)+68)
A/art﹕ art/runtime/check_jni.cc:65] native: #06 pc 000b4b4d /system/lib/libart.so (art::ScopedCheck::ScopedCheck(_JNIEnv*, int, char const*)+1324)
A/art﹕ art/runtime/check_jni.cc:65] native: #07 pc 000bcf23 /system/lib/libart.so (art::CheckJNI::CallVoidMethodV(_JNIEnv*, _jobject*, _jmethodID*, std::__va_list)+42)
A/art﹕ art/runtime/check_jni.cc:65] native: #08 pc 00060ad3 /system/lib/libandroid_runtime.so (???)
A/art﹕ art/runtime/check_jni.cc:65] native: #09 pc 0007474d /system/lib/libandroid_runtime.so (android::NativeDisplayEventReceiver::dispatchVsync(long long, int, unsigned int)+40)
A/art﹕ art/runtime/check_jni.cc:65] native: #10 pc 00074915 /system/lib/libandroid_runtime.so (android::NativeDisplayEventReceiver::handleEvent(int, int, void*)+80)
A/art﹕ art/runtime/check_jni.cc:65] native: #11 pc 00012545 /system/lib/libutils.so (android::Looper::pollInner(int)+484)
A/art﹕ art/runtime/check_jni.cc:65] native: #12 pc 000125ed /system/lib/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+92)
A/art﹕ art/runtime/check_jni.cc:65] native: #13 pc 0007fb61 /system/lib/libandroid_runtime.so (android::NativeMessageQueue::pollOnce(_JNIEnv*, int)+22)
A/art﹕ art/runtime/check_jni.cc:65] native: #14 pc 000b0de7 /data/dalvik-cache/arm/[email protected]@boot.oat (Java_android_os_MessageQueue_nativePollOnce__JI+102)
A/art﹕ art/runtime/check_jni.cc:65] at android.os.MessageQueue.nativePollOnce(Native method)
A/art﹕ art/runtime/check_jni.cc:65] at android.os.MessageQueue.next(MessageQueue.java:143)
A/art﹕ art/runtime/check_jni.cc:65] at android.os.Looper.loop(Looper.java:122)
A/art﹕ art/runtime/check_jni.cc:65] at android.app.ActivityThread.main(ActivityThread.java:5221)
A/art﹕ art/runtime/check_jni.cc:65] at java.lang.reflect.Method.invoke!(Native method)
A/art﹕ art/runtime/check_jni.cc:65] at java.lang.reflect.Method.invoke(Method.java:372)
A/art﹕ art/runtime/check_jni.cc:65] at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
A/art﹕ art/runtime/check_jni.cc:65] at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
A/art﹕ art/runtime/check_jni.cc:65]
A/art﹕ art/runtime/runtime.cc:283] Runtime aborting...
A/art﹕ art/runtime/runtime.cc:283] Aborting thread:
A/art﹕ art/runtime/runtime.cc:283] "main" prio=9 tid=1 Native
A/art﹕ art/runtime/runtime.cc:283] | group="" sCount=0 dsCount=0 obj=0x737d5ec0 self=0xb5007800
A/art﹕ art/runtime/runtime.cc:283] | sysTid=31960 nice=-6 cgrp=apps sched=0/0 handle=0xb6f40ec8
A/art﹕ art/runtime/runtime.cc:283] | state=R schedstat=(285595822403 174647533456 1598201) utm=17213 stm=11346 core=1 HZ=100
A/art﹕ art/runtime/runtime.cc:283] | stack=0xbe3ad000-0xbe3af000 stackSize=8MB
A/art﹕ art/runtime/runtime.cc:283] | held mutexes= "abort lock" "mutator lock"(shared held)
A/art﹕ art/runtime/runtime.cc:283] native: #00 pc 00004c58 /system/lib/libbacktrace_libc++.so (UnwindCurrent::Unwind(unsigned int, ucontext*)+23)
A/art﹕ art/runtime/runtime.cc:283] native: #01 pc 000034c1 /system/lib/libbacktrace_libc++.so (Backtrace::Unwind(unsigned int, ucontext*)+8)
A/art﹕ art/runtime/runtime.cc:283] native: #02 pc 0025918d /system/lib/libart.so (art::DumpNativeStack(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, int, char const*, art::mirror::ArtMethod*)+84)
A/art﹕ art/runtime/runtime.cc:283] native: #03 pc 0023cd13 /system/lib/libart.so (art::Thread::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const+162)
A/art﹕ art/runtime/runtime.cc:283] native: #04 pc 0022c6a9 /system/lib/libart.so (art::AbortState::DumpThread(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, art::Thread*)+32)
A/art﹕ art/runtime/runtime.cc:283] native: #05 pc 0022c94b /system/lib/libart.so (art::AbortState::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char> >&)+410)
A/art﹕ art/runtime/runtime.cc:283] native: #06 pc 0022cb0b /system/lib/libart.so (art::Runtime::Abort()+82)
A/art﹕ art/runtime/runtime.cc:283] native: #07 pc 000a7269 /system/lib/libart.so (art::LogMessage::~LogMessage()+1360)
A/art﹕ art/runtime/runtime.cc:283] native: #08 pc 000b1381 /system/lib/libart.so (art::JniAbort(char const*, char const*)+1112)
A/art﹕ art/runtime/runtime.cc:283] native: #09 pc 000b18c5 /system/lib/libart.so (art::JniAbortF(char const*, char const*, ...)+68)
A/art﹕ art/runtime/runtime.cc:283] native: #10 pc 000b4b4d /system/lib/libart.so (art::ScopedCheck::ScopedCheck(_JNIEnv*, int, char const*)+1324)
A/art﹕ art/runtime/runtime.cc:283] native: #11 pc 000bcf23 /system/lib/libart.so (art::CheckJNI::CallVoidMethodV(_JNIEnv*, _jobject*, _jmethodID*, std::__va_list)+42)
A/art﹕ art/runtime/runtime.cc:283] native: #12 pc 00060ad3 /system/lib/libandroid_runtime.so (???)
A/art﹕ art/runtime/runtime.cc:283] native: #13 pc 0007474d /system/lib/libandroid_runtime.so (android::NativeDisplayEventReceiver::dispatchVsync(long long, int, unsigned int)+40)
A/art﹕ art/runtime/runtime.cc:283] native: #14 pc 00074915 /system/lib/libandroid_runtime.so (android::NativeDisplayEventReceiver::handleEvent(int, int, void*)+80)
A/art﹕ art/runtime/runtime.cc:283] native: #15 pc 00012545 /system/lib/libutils.so (android::Looper::pollInner(int)+484)
A/art﹕ art/runtime/runtime.cc:283] native: #16 pc 000125ed /system/lib/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+92)
A/art﹕ art/runtime/runtime.cc:283] native: #17 pc 0007fb61 /system/lib/libandroid_runtime.so (android::NativeMessageQueue::pollOnce(_JNIEnv*, int)+22)
A/art﹕ art/runtime/runtime.cc:283] native: #18 pc 000b0de7 /data/dalvik-cache/arm/[email protected]@boot.oat (Java_android_os_MessageQueue_nativePollOnce__JI+102)
A/art﹕ art/runtime/runtime.cc:283] at android.os.MessageQueue.nativePollOnce(Native method)
A/art﹕ art/runtime/runtime.cc:283] at android.os.MessageQueue.next(MessageQueue.java:143)
A/art﹕ art/runtime/runtime.cc:283] at android.os.Looper.loop(Looper.java:122)
A/art﹕ art/runtime/runtime.cc:283] at android.app.ActivityThread.main(ActivityThread.java:5221)
A/art﹕ art/runtime/runtime.cc:283] at java.lang.reflect.Method.invoke!(Native method)
A/art﹕ art/runtime/runtime.cc:283] at java.lang.reflect.Method.invoke(Method.java:372)
A/art﹕ art/runtime/runtime.cc:283] at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
A/art﹕ art/runtime/runtime.cc:283] at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
A/art﹕ art/runtime/runtime.cc:283] Pending exception java.lang.IllegalStateException thrown by 'void android.os.MessageQueue.nativePollOnce(long, int):-2'
A/art﹕ art/runtime/runtime.cc:283] java.lang.IllegalStateException: Unable to create layer for TextView
A/art﹕ art/runtime/runtime.cc:283] at void android.os.MessageQueue.nativePollOnce(long, int) (MessageQueue.java:-2)
A/art﹕ art/runtime/runtime.cc:283] at android.os.Message android.os.MessageQueue.next() (MessageQueue.java:143)
A/art﹕ art/runtime/runtime.cc:283] at void android.os.Looper.loop() (Looper.java:122)
A/art﹕ art/runtime/runtime.cc:283] at void android.app.ActivityThread.main(java.lang.String[]) (ActivityThread.java:5221)
A/art﹕ art/runtime/runtime.cc:283] at java.lang.Object java.lang.reflect.Method.invoke!(java.lang.Object, java.lang.Object[], boolean) (Method.java:-2)
A/art﹕ art/runtime/runtime.cc:283] at java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object[]) (Method.java:372)
A/art﹕ art/runtime/runtime.cc:283] at void com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run() (ZygoteInit.java:899)
A/art﹕ art/runtime/runtime.cc:283] at void com.android.internal.os.ZygoteInit.main(java.lang.String[]) (ZygoteInit.java:694)
A/art﹕ art/runtime/runtime.cc:283] Dumping all threads without appropriate locks held: thread list lock mutator lock
A/art﹕ art/runtime/runtime.cc:283] All threads:
A/art﹕ art/runtime/runtime.cc:283] DALVIK THREADS (52):
A/art﹕ art/runtime/runtime.cc:283] "main" prio=9 tid=1 Native
A/art﹕ art/runtime/runtime.cc:283] | group="" sCount=0 dsCount=0 obj=0x737d5ec0 self=0xb5007800
A/art﹕ art/runtime/runtime.cc:283] | sysTid=31960 nice=-6 cgrp=apps sched=0/0 handle=0xb6f40ec8
A/art﹕ art/runtime/runtime.cc:283] | state=R schedstat=(285618908185 174654076164 1598229) utm=17214 stm=11347 core=0 HZ=100
A/art﹕ art/runtime/runtime.cc:283] | stack=0xbe3ad000-0xbe3af000 stackSize=8MB
A/art﹕ art/runtime/runtime.cc:283] | held mutexes= "abort lock"
A/art﹕ art/runtime/runtime.cc:283] native: #00 pc 00004c58 /system/lib/libbacktrace_libc++.so (UnwindCurrent::Unwind(unsigned int, ucontext*)+23)
A/art﹕ art/runtime/runtime.cc:283] native: #01 pc 000034c1 /system/lib/libbacktrace_libc++.so (Backtrace::Unwind(unsigned int, ucontext*)+8)
A/art﹕ art/runtime/runtime.cc:283] native: #02 pc 0025918d /system/lib/libart.so (art::DumpNativeStack(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, int, char const*, art::mirror::ArtMethod*)+84)
A/art﹕ art/runtime/runtime.cc:283] native: #03 pc 0023cd13 /system/lib/libart.so (art::Thread::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const+162)
A/art﹕ art/runtime/runtime.cc:283] native: #04 pc 00245ea5 /system/lib/libart.so (art::ThreadList::DumpLocked(std::__1::basic_ostream<char, std::__1::char_traits<char> >&)+120)
A/art﹕ art/runtime/runtime.cc:283] native: #05 pc 0022c8c1 /system/lib/libart.so (art::AbortState::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char> >&)+272)
A/art﹕ art/runtime/runtime.cc:283] native: #06 pc 0022cb0b /system/lib/libart.so (art::Runtime::Abort()+82)
A/art﹕ art/runtime/runtime.cc:283] native: #07 pc 000a7269 /system/lib/libart.so (art::LogMessage::~LogMessage()+1360)
A/art﹕ art/runtime/runtime.cc:283] native: #08 pc 000b1381 /system/lib/libart.so (art::JniAbort(char const*, char const*)+1112)
A/art﹕ art/runtime/runtime.cc:283] native: #09 pc 000b18c5 /system/lib/libart.so (art::JniAbortF(char const*, char const*, ...)+68)
A/art﹕ art/runtime/runtime.cc:283] native: #10 pc 000b4b4d /system/lib/libart.so (art::ScopedCheck::ScopedCheck(_JNIEnv*, int, char const*)+1324)
A/art﹕ art/runtime/runtime.cc:283] native: #11 pc 000bcf23 /system/lib/libart.so (art::CheckJNI::CallVoidMethodV(_JNIEnv*, _jobject*, _jmethodID*, std::__va_list)+42)
A/art﹕ art/runtime/runtime.cc:283] native: #12 pc 00060ad3 /system/lib/libandroid_runtime.so (???)
A/art﹕ art/runtime/runtime.cc:283] native: #13 pc 0007474d /system/lib/libandroid_runtime.so (android::NativeDisplayEventReceiver::dispatchVsync(long long, int, unsigned int)+40)
A/art﹕ art/runtime/runtime.cc:283] native: #14 pc 00074915 /system/lib/libandroid_runtime.so (android::NativeDisplayEventReceiver::handleEvent(int, int, void*)+80)
A/art﹕ art/runtime/runtime.cc:283] native: #15 pc 00012545 /system/lib/libutils.so (android::Looper::pollInner(int)+484)
A/art﹕ art/runtime/runtime.cc:283] native: #16 pc 000125ed /system/lib/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+92)
A/art﹕ art/runtime/runtime.cc:283] native: #17 pc 0007fb61 /system/lib/libandroid_runtime.so (android::NativeMessageQueue::pollOnce(_JNIEnv*, int)+22)
A/art﹕ art/runtime/runtime.cc:283] native: #18 pc 000b0de7 /data/dalvik-cache/arm/[email protected]@boot.oat (Java_android_os_MessageQueue_nativePollOnce__JI+102)
A/art﹕ art/runtime/runtime.cc:283] at android.os.MessageQueue.nativePollOnce(Native method)
A/art﹕ art/runtime/runtime.cc:283] at android.os.MessageQueue.next(MessageQueue.java:143)
A/art﹕ art/runtime/runtime.cc:283] at android.os.Looper.loop(Looper.java:122)
A/art﹕ art/runtime/runtime.cc:283] at android.app.ActivityThread.main(ActivityThread.java:5221)
A/art﹕ art/runtime/runtime.cc:283] at java.lang.reflect.Method.invoke!(Native method)
A/art﹕ art/runtime/runtime.cc:283] at java.lang.reflect.Method.invoke(Method.java:372)
A/art﹕ art/runtime/runtime.cc:283] at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
A/art﹕ art/runtime/runtime.cc:283] at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
A/art﹕ art/runtime/runtime.cc:283]
A/art﹕ art/runtime/runtime.cc:283] "Heap thread pool worker thread 0" prio=9 tid=2 Native (still starting up)
A/art﹕ art/runtime/runtime.cc:283] | group="" sCount=0 dsCount=0 obj=0x0 self=0xafe0e400
A/art﹕ art/runtime/runtime.cc:283] | sysTid=31966 nice=0 cgrp=apps sched=0/0 handle=0xac5a1a00
A/art﹕ art/runtime/runtime.cc:283] | state=S schedstat=(879428 6643385 8) utm=0 stm=0 core=1 HZ=100
A/art﹕ art/runtime/runtime.cc:283] | stack=0xb4847000-0xb4849000 stackSize=1020KB
A/art﹕ art/runtime/runtime.cc:283] | held mutexes=
A/art﹕ art/runtime/runtime.cc:283] native: #00 pc 00012e98 /system/lib/libc.so (syscall+28)
A/art﹕ art/runtime/runtime.cc:283] native: #01 pc 000a9fa3 /system/lib/libart.so (art::ConditionVariable::Wait(art::Thread*)+98)
A/art﹕ art/runtime/runtime.cc:283] native: #02 pc 0024714d /system/lib/libart.so (art::ThreadPool::GetTask(art::Thread*)+64)
A/art﹕ art/runtime/runtime.cc:283] native: #03 pc 002470e7 /system/lib/libart.so (art::ThreadPoolWorker::Run()+62)
A/art﹕ art/runtime/runtime.cc:283] native: #04 pc 002479d5 /system/lib/libart.so (art::ThreadPoolWorker::Callback(void*)+60)
A/art﹕ art/runtime/runtime.cc:283] native: #05 pc 000162e3 /system/lib/libc.so (__pthread_start(void*)+30)
A/art﹕ art/runtime/runtime.cc:283] native: #06 pc 000142d3 /system/lib/libc.so (__start_thread+6)
A/art﹕ art/runtime/runtime.cc:283] (no managed stack frames)
A/art﹕ art/runtime/runtime.cc:283]
A/art﹕ art/runtime/runtime.cc:283] "Heap thread pool worker thread 2" prio=9 tid=3 Native (still starting up)
A/art﹕ art/runtime/runtime.cc:283] | group="" sCount=0 dsCount=0 obj=0x0 self=0xafb0e400
A/art﹕ art/runtime/runtime.cc:283] | sysTid=31968 nice=0 cgrp=apps sched=0/0 handle=0xac5a1f00
A/art﹕ art/runtime/runtime.cc:283] | state=S schedstat=(739842 1013075 7) utm=0 stm=0 core=1 HZ=100
A/art﹕ art/runtime/runtime.cc:283] | stack=0xb4645000-0xb4647000 stackSize=1020KB
A/art﹕ art/runtime/runtime.cc:283] | held mutexes=
A/art﹕ art/runtime/runtime.cc:283] native: #00 pc 00012e98 /system/lib/libc.so (syscall+28)
A/art﹕ art/runtime/runtime.cc:283] native: #01 pc 000a9fa3 /system/lib/libart.so (art::ConditionVariable::Wait(art::Thread*)+98)
A/art﹕ art/runtime/runtime.cc:283] native: #02 pc 0024714d /system/lib/libart.so (art::ThreadPool::GetTask(art::Thread*)+64)
A/art﹕ art/runtime/runtime.cc:283] native: #03 pc 002470e7 /system/lib/libart.so (art::ThreadPoolWorker::Run()+62)
A/art﹕ art/runtime/runtime.cc:283] native: #04 pc 002479d5 /system/lib/libart.so (art::ThreadPoolWorker::Callback(void*)+60)
A/art﹕ art/runtime/runtime.cc:283] native: #05 pc 000162e3 /system/lib/libc.so (__pthread_start(void*)+30)
A/art﹕ art/runtime/runtime.cc:283] native: #06 pc 000142d3 /system/lib/libc.so (__start_thread+6)
A/art﹕ art/runtime/runtime.cc:283] (no managed stack frames)
nie mogę dodać cały logcat więc wklejony resztę na pastebin. Link do pastebin to here.
Dzięki za pomoc!
Czy znalazłeś jakieś rozwiązanie? Dzięki! –
Mam ten sam problem, czy zgłosiłeś go do google? – Bri6ko
Proszę, możesz wypróbować przykładowy ciąg ~ 3800 znaków, których używasz w swoim 'TextView', gdy nastąpi awaria – donturner