Application loading slow and how to use strict mode in android - android

I am facing lots of message through strict mode in logcat. May be this reason if i click next buttton on ui, then it takes long time almost 1 min. How to occure this, data loading process is fast. but why got strict mode log? i don't know.
and finally, how to use strict mode in my 4.1.6 . what is the meaning of DEVELOPER_MODE. , StrictMode details ,
sample of logcat:
11-27 13:08:14.220: D/StrictMode(11010): StrictMode policy violation; ~duration=1492 ms: android.os.StrictMode$StrictModeDiskReadViolation: policy=23 violation=2
11-27 13:08:14.220: D/StrictMode(11010): at android.os.StrictMode$AndroidBlockGuardPolicy.onReadFromDisk(StrictMode.java:1135)
11-27 13:08:14.220: D/StrictMode(11010): at android.database.sqlite.SQLiteConnection.applyBlockGuardPolicy(SQLiteConnection.java:1041)
11-27 13:08:14.220: D/StrictMode(11010): at android.database.sqlite.SQLiteConnection.executeForLong(SQLiteConnection.java:595)
11-27 13:08:14.220: D/StrictMode(11010): at android.database.sqlite.SQLiteConnection.setForeignKeyModeFromConfiguration(SQLiteConnection.java:281)
11-27 13:08:14.220: D/StrictMode(11010): at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:214)
11-27 13:08:14.220: D/StrictMode(11010): at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:193)
11-27 13:08:14.220: D/StrictMode(11010): at android.database.sqlite.SQLiteConnectionPool.openConnectionLocked(SQLiteConnectionPool.java:463)
11-27 13:08:14.220: D/StrictMode(11010): at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:185)
11-27 13:08:14.220: D/StrictMode(11010): at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:177)
11-27 13:08:14.220: D/StrictMode(11010): at android.database.sqlite.SQLiteDatabase.openInner(SQLiteDatabase.java:804)
11-27 13:08:14.220: D/StrictMode(11010): at android.database.sqlite.SQLiteDatabase.open(SQLiteDatabase.java:789)
11-27 13:08:14.220: D/StrictMode(11010): at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:694)
11-27 13:08:14.220: D/StrictMode(11010): at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:952)
11-27 13:08:14.220: D/StrictMode(11010): at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:256)
11-27 13:08:14.220: D/StrictMode(11010): at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:224)
11-27 13:08:14.220: D/StrictMode(11010): at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:164)
11-27 13:08:14.220: D/StrictMode(11010): at com.project.dc.databases.DBAdapter.open(DBAdapter.java:224)
11-27 13:08:14.220: D/StrictMode(11010): at com.project.dc.activity.RunFormActivity.saveOnSwipe(RunFormActivity.java:10641)
11-27 13:08:14.220: D/StrictMode(11010): at com.project.dc.activity.RunFormActivity$34.onClick(RunFormActivity.java:2575)
11-27 13:08:14.220: D/StrictMode(11010): at android.view.View.performClick(View.java:4438)
11-27 13:08:14.220: D/StrictMode(11010): at android.view.View$PerformClick.run(View.java:18422)
11-27 13:08:14.220: D/StrictMode(11010): at android.os.Handler.handleCallback(Handler.java:733)
11-27 13:08:14.220: D/StrictMode(11010): at android.os.Handler.dispatchMessage(Handler.java:95)
11-27 13:08:14.220: D/StrictMode(11010): at android.os.Looper.loop(Looper.java:136)
11-27 13:08:14.220: D/StrictMode(11010): at android.app.ActivityThread.main(ActivityThread.java:5001)
11-27 13:08:14.220: D/StrictMode(11010): at java.lang.reflect.Method.invokeNative(Native Method)
11-27 13:08:14.220: D/StrictMode(11010): at java.lang.reflect.Method.invoke(Method.java:515)
11-27 13:08:14.220: D/StrictMode(11010): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
11-27 13:08:14.220: D/StrictMode(11010): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
11-27 13:08:14.220: D/StrictMode(11010): at dalvik.system.NativeStart.main(Native Method)
i have getting following strict mode(logcat): http://pastebin.com/jeDa0YNA
I have depress this by taking this problem: please could you give some idea how to fix this.

Your application is performing database operations on main Thread. So you are getting this error.
Move the saveonswipe call in OnClick to an AsyncTask

Related

Google has stopped error dialog when using SpeechRecogniser Api

I am using Speech Recogniser in my app. If I am trying ok google and at the same time launching my app for speech recognition, then performing these steps repeatedly causing crash of google app. I am getting this an error dialog saying "Google has stopped" and log exception as :
FATAL EXCEPTION: LocalEngine0
11-27 17:33:21.801 E/AndroidRuntime( 4490): Process: com.google.android.googlequicksearchbox:search, PID: 4490
11-27 17:33:21.801 E/AndroidRuntime( 4490): java.lang.RuntimeException: Unchecked exception running task: ThreadChanger: a.a(w, b, c)
11-27 17:33:21.801 E/AndroidRuntime( 4490): at com.google.android.apps.gsa.shared.util.concurrent.a.ba.setException(SourceFile:20)
11-27 17:33:21.801 E/AndroidRuntime( 4490): at java.util.concurrent.FutureTask.run(FutureTask.java:242)
11-27 17:33:21.801 E/AndroidRuntime( 4490): at com.google.android.apps.gsa.shared.util.concurrent.a.ae.run(SourceFile:11)
11-27 17:33:21.801 E/AndroidRuntime( 4490): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
11-27 17:33:21.801 E/AndroidRuntime( 4490): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
11-27 17:33:21.801 E/AndroidRuntime( 4490): at java.lang.Thread.run(Thread.java:761)
11-27 17:33:21.801 E/AndroidRuntime( 4490): at com.google.android.apps.gsa.shared.util.concurrent.a.ak.run(SourceFile:6)
11-27 17:33:21.801 E/AndroidRuntime( 4490): Caused by: java.lang.IllegalStateException
11-27 17:33:21.801 E/AndroidRuntime( 4490): at com.google.common.base.Preconditions.checkState(SourceFile:33)
11-27 17:33:21.801 E/AndroidRuntime( 4490): at com.google.android.apps.gsa.speech.e.c.b.a(SourceFile:103)
11-27 17:33:21.801 E/AndroidRuntime( 4490): at com.google.android.apps.gsa.staticplugins.recognizer.c.a.a(SourceFile:31)
11-27 17:33:21.801 E/AndroidRuntime( 4490): at java.lang.reflect.Method.invoke(Native Method)
11-27 17:33:21.801 E/AndroidRuntime( 4490): at com.google.android.apps.gsa.shared.util.bn.run(SourceFile:9)
11-27 17:33:21.801 E/AndroidRuntime( 4490): at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:428)
11-27 17:33:21.801 E/AndroidRuntime( 4490): at java.util.concurrent.FutureTask.run(FutureTask.java:237)
11-27 17:33:21.801 E/AndroidRuntime( 4490): ... 5 more
11-27 17:33:21.805 W/ActivityManager( 3327): Force finishing activity com.google.android.googlequicksearchbox/com.google.android.apps.gsa.lockscreenentry.LockscreenEntryActivity
How can i overcome this error.
To prevent false positives, hotword detection is disabled when a spoken feedback service is enabled.
add android:accessibilityFeedbackType="feedbackAllMask"
configure the service using an XML file
<accessibility-service
android:accessibilityEventTypes="typeViewClicked|typeViewFocused"
android:packageNames="com.example.android.myFirstApp,com.example.android.mySecondApp"
android:accessibilityFeedbackType="feedbackAllMask"
android:notificationTimeout="100"
android:settingsActivity="com.example.android.apis.accessibility.TestBackActivity"
android:canRetrieveWindowContent="true"/>
You can also refer these link one,two
Hope it will to you!!

Fragment can not be cast to android.support.v4.app.Fragment

I am getting this error while implementing Fragment tabhost.
I am basically trying to call an activity in tab view which extends Fragment.
I also tried with extending FragmentActivity, but it gives an error on "onCreateView" method.
Upon removing #override annotation from "onCreateView" method, and running the app lead to following error.
11-27 20:54:06.937: E/AndroidRuntime(4255): FATAL EXCEPTION: main
11-27 20:54:06.937: E/AndroidRuntime(4255): java.lang.ClassCastException: com.variouscal.calculators.FragmentTab1 cannot be cast to android.support.v4.app.Fragment
11-27 20:54:06.937: E/AndroidRuntime(4255): at android.support.v4.app.Fragment.instantiate(Fragment.java:394)
11-27 20:54:06.937: E/AndroidRuntime(4255): at android.support.v4.app.FragmentTabHost.doTabChanged(FragmentTabHost.java:339)
11-27 20:54:06.937: E/AndroidRuntime(4255): at android.support.v4.app.FragmentTabHost.onTabChanged(FragmentTabHost.java:307)
11-27 20:54:06.937: E/AndroidRuntime(4255): at android.widget.TabHost.invokeOnTabChangeListener(TabHost.java:391)
11-27 20:54:06.937: E/AndroidRuntime
(4255): at android.widget.TabHost.setCurrentTab(TabHost.java:376)
11-27 20:54:06.937: E/AndroidRuntime(4255): at android.widget.TabHost$2.onTabSelectionChanged(TabHost.java:150)
11-27 20:54:06.937: E/AndroidRuntime(4255): at android.widget.TabWidget$TabClickListener.onClick(TabWidget.java:546)
11-27 20:54:06.937: E/AndroidRuntime(4255): at android.view.View.performClick(View.java:4084)
11-27 20:54:06.937: E/AndroidRuntime(4255): at android.view.View$PerformClick.run(View.java:16966)
11-27 20:54:06.937: E/AndroidRuntime(4255): at android.os.Handler.handleCallback(Handler.java:615)
11-27 20:54:06.937: E/AndroidRuntime(4255): at android.os.Handler.dispatchMessage(Handler.java:92)
11-27 20:54:06.937: E/AndroidRuntime(4255): at android.os.Looper.loop(Looper.java:137)
11-27 20:54:06.937: E/AndroidRuntime(4255): at android.app.ActivityThread.main(ActivityThread.java:4931)
11-27 20:54:06.937: E/AndroidRuntime(4255): at java.lang.reflect.Method.invokeNative(Native Method)
11-27 20:54:06.937: E/AndroidRuntime(4255): at java.lang.reflect.Method.invoke(Method.java:511)
11-27 20:54:06.937: E/AndroidRuntime(4255): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)
11-27 20:54:06.937: E/AndroidRuntime(4255): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:558)
11-27 20:54:06.937: E/AndroidRuntime(4255): at dalvik.system.NativeStart.main(Native Method)
The problem is that there are two versions of Fragment:
android.app.Fragment
android.support.v4.app.Fragment
Be sure to import the correct one and be consistent.
Without code this is more of a guess but it sounds like your are trying to use android.app.Fragment with android.support.v4.app.Fragment which you cannot do

Unfortunately, "appname" has stopped

I've completed and managed to install the app (i'm following a tutorial), but when running it on the emulator or real device, it gives me the error message, Unfortunately, has stopped.
Log cat
11-27 09:57:54.669: I/Process(1373): Sending signal. PID: 1373 SIG: 9
11-27 09:58:08.729: D/AndroidRuntime(1397): Shutting down VM
11-27 09:58:08.729: W/dalvikvm(1397): threadid=1: thread exiting with uncaught exception (group=0xb3aa4b90)
11-27 09:58:08.899: E/AndroidRuntime(1397): FATAL EXCEPTION: main
11-27 09:58:08.899: E/AndroidRuntime(1397): Process: com.davidgassner.plainolnotes, PID: 1397
11-27 09:58:08.899: E/AndroidRuntime(1397): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.davidgassner.plainolnotes/com.davidgassner.plainolnotes.Quick_Note_Taker} : java.lang.ClassNotFoundException: Didn't find class "com.davidgassner.plainolnotes.Quick_Note_Taker" on path: DexPathList[[zip file "/data/app/com.davidgassner.plainolnotes-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.davidgassner.plainolnotes-2, /system/lib]]
11-27 09:58:08.899: E/AndroidRuntime(1397): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2102)
11-27 09:58:08.899: E/AndroidRuntime(1397): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2226)
11-27 09:58:08.899: E/AndroidRuntime(1397): at android.app.ActivityThread.access$700(ActivityThread.java:135)
11-27 09:58:08.899: E/AndroidRuntime(1397): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1397)
11-27 09:58:08.899: E/AndroidRuntime(1397): at android.os.Handler.dispatchMessage(Handler.java:102)
11-27 09:58:08.899: E/AndroidRuntime(1397): at android.os.Looper.loop(Looper.java:137)
11-27 09:58:08.899: E/AndroidRuntime(1397): at android.app.ActivityThread.main(ActivityThread.java:4998)
11-27 09:58:08.899: E/AndroidRuntime(1397): at java.lang.reflect.Method.invokeNative(Native Method)
11-27 09:58:08.899: E/AndroidRuntime(1397): at java.lang.reflect.Method.invoke(Method.java:515)
11-27 09:58:08.899: E/AndroidRuntime(1397): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:777)
11-27 09:58:08.899: E/AndroidRuntime(1397): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:593)
11-27 09:58:08.899: E/AndroidRuntime(1397): at dalvik.system.NativeStart.main(Native Method)
11-27 09:58:08.899: E/AndroidRuntime(1397): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.davidgassner.plainolnotes.Quick_Note_Taker" on path: DexPathList[[zip file "/data/app/com.davidgassner.plainolnotes-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.davidgassner.plainolnotes-2, /system/lib]]
11-27 09:58:08.899: E/AndroidRuntime(1397): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
11-27 09:58:08.899: E/AndroidRuntime(1397): at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
11-27 09:58:08.899: E/AndroidRuntime(1397): at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
11-27 09:58:08.899: E/AndroidRuntime(1397): at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
11-27 09:58:08.899: E/AndroidRuntime(1397): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2093)
11-27 09:58:08.899: E/AndroidRuntime(1397): ... 11 more
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.davidgassner.plainolnotes"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="13"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label=" Quick Note Taker"
android:theme="#style/AppTheme" >
<activity
android:name="Quick_Note_Taker"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".NoteEditorActivity"/>
</application>
</manifest>
Could anyone help me figure out what the root of the problem is? If anything else is needed, tell me.
Thanks in advanced.
Your manifest (amongst other things) defines what Activites your app uses. One of those activities will be marked as the one to be started by the launcher. In this case it is:
<activity
android:name="Quick_Note_Taker"
So Android will attempt to instantiate an instance of Quick_Note_Taker.java. It will look for this class within the APK in a path equivalent to this one in your source code: src/com/davidgassner/plainolnotes/. Within Eclipse, that is the same as what is shown under the path ProjectName/src/com.davidgassner.plainolnotes/ in Package Explorer.
You say that you have no file named Quick_Note_Taker.java, hence this error. You do however have a file called MainActivity.java which is the default Activity class created for you when you create a new Android Application Project. When you created your project, you could/should have changed this to Quick_Note_Taker instead of MainActivity. But that's not a big deal.
You could replace MainActivity with a class file called Quick_Note_Taker instead. Or the easy (and perfectly valid) option is to change the activity name from Quick_Note_Taker to ActivityMain in the manifest.

app runs on one device but not another

FIXED
For some reason the special menu i created was killing it... THere was no API's or anything in that class. But thanks for the support guys
So this really isnt a question about a code but a very random error...
My app runs perfectly on my Nexus S rooted, but when it runs on any other phone or the emulator it will instantly FC.
The app does have root permissions but only if you choose to use it. Otherwise it is just a normal application.
Does anyone have a solution to why it would run on one device but not another?
-EDIT-
11-27 17:28:37.734: E/AndroidRuntime(7104): FATAL EXCEPTION: main
11-27 17:28:37.734: E/AndroidRuntime(7104): java.lang.VerifyError: com.SyndicateApps.OmegaLauncher.Launcher
11-27 17:28:37.734: E/AndroidRuntime(7104): at java.lang.Class.newInstanceImpl(Native Method)
11-27 17:28:37.734: E/AndroidRuntime(7104): at java.lang.Class.newInstance(Class.java:1429)
11-27 17:28:37.734: E/AndroidRuntime(7104): at android.app.Instrumentation.newActivity(Instrumentation.java:1056)
11-27 17:28:37.734: E/AndroidRuntime(7104): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2752)
11-27 17:28:37.734: E/AndroidRuntime(7104): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2859)
11-27 17:28:37.734: E/AndroidRuntime(7104): at android.app.ActivityThread.access$2300(ActivityThread.java:136)
11-27 17:28:37.734: E/AndroidRuntime(7104): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2179)
11-27 17:28:37.734: E/AndroidRuntime(7104): at android.os.Handler.dispatchMessage(Handler.java:99)
11-27 17:28:37.734: E/AndroidRuntime(7104): at android.os.Looper.loop(Looper.java:143)
11-27 17:28:37.734: E/AndroidRuntime(7104): at android.app.ActivityThread.main(ActivityThread.java:5073)
11-27 17:28:37.734: E/AndroidRuntime(7104): at java.lang.reflect.Method.invokeNative(Native Method)
11-27 17:28:37.734: E/AndroidRuntime(7104): at java.lang.reflect.Method.invoke(Method.java:521)
11-27 17:28:37.734: E/AndroidRuntime(7104): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
11-27 17:28:37.734: E/AndroidRuntime(7104): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
11-27 17:28:37.734: E/AndroidRuntime(7104): at dalvik.system.NativeStart.main(Native Method)
EDIT 2 -
So its on 2.2 but same problem... Is there a way i can find the class using the api level 9?
LOGCAT 2 (on android 2.2)
EDIT 2 / SECOND LOGCAT ON 2.2 EMULATOR -
11-27 18:56:12.159: E/AndroidRuntime(258): FATAL EXCEPTION: main
11-27 18:56:12.159: E/AndroidRuntime(258): java.lang.VerifyError: com.SyndicateApps.OmegaLauncher.Launcher
11-27 18:56:12.159: E/AndroidRuntime(258): at java.lang.Class.newInstanceImpl(Native Method)
11-27 18:56:12.159: E/AndroidRuntime(258): at java.lang.Class.newInstance(Class.java:1429)
11-27 18:56:12.159: E/AndroidRuntime(258): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
11-27 18:56:12.159: E/AndroidRuntime(258): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2577)
11-27 18:56:12.159: E/AndroidRuntime(258): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
11-27 18:56:12.159: E/AndroidRuntime(258): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
11-27 18:56:12.159: E/AndroidRuntime(258): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
11-27 18:56:12.159: E/AndroidRuntime(258): at android.os.Handler.dispatchMessage(Handler.java:99)
11-27 18:56:12.159: E/AndroidRuntime(258): at android.os.Looper.loop(Looper.java:123)
11-27 18:56:12.159: E/AndroidRuntime(258): at android.app.ActivityThread.main(ActivityThread.java:4627)
11-27 18:56:12.159: E/AndroidRuntime(258): at java.lang.reflect.Method.invokeNative(Native Method)
11-27 18:56:12.159: E/AndroidRuntime(258): at java.lang.reflect.Method.invoke(Method.java:521)
11-27 18:56:12.159: E/AndroidRuntime(258): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
11-27 18:56:12.159: E/AndroidRuntime(258): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
11-27 18:56:12.159: E/AndroidRuntime(258): at dalvik.system.NativeStart.main(Native Method)
A lot of the errors are when it comes to this... --> (new DialogInterface.OnShowListener()
java.lang.VerifyError typically means you're using a class or method that's not available on the current Java VM. Which Android version is on Nexus and which is on the other device? Android app manifest system allows for compiling against, say, API level 10 while allowing running against API level 6. There will be no warning against using backwards-incompatible classes until you run.
EDIT: So apparently the class com.SyndicateApps.OmegaLauncher.Launcher uses some API that was introduced in level 9. In the project properties, under "Android", set build target (temporarily) to Android 2.2 and see where the errors occur.
EDIT2: if the static analysis fails, try commenting out method insides in the class, method by method, until it loads. VerifyError is fairly easy to debug that way - it's triggered by very existence of faulty code in the class, not by its invokation. It's not like you have to do 100% coverage analysis.

how to solve this issue"The content of the adapter has changed but ListView did not receive a notification"?

11-27 13:24:08.203: ERROR/AndroidRuntime(556): Uncaught handler: thread main exiting due to uncaught exception
11-27 13:24:08.628: ERROR/AndroidRuntime(556): java.lang.IllegalStateException: The content of the adapter has changed but ListView did not receive a notification. Make sure the content of your adapter is not modified from a background thread, but only from the UI thread. [in ListView(2131165233, class android.widget.ListView) with Adapter(class com.bluepal.android.iConcierge.CustomAdapter)]
11-27 13:24:08.628: ERROR/AndroidRuntime(556): at android.widget.ListView.layoutChildren(ListView.java:1432)
11-27 13:24:08.628: ERROR/AndroidRuntime(556): at android.widget.AbsListView.onLayout(AbsListView.java:1113)
11-27 13:24:08.628: ERROR/AndroidRuntime(556): at android.view.View.layout(View.java:6830)
11-27 13:24:08.628: ERROR/AndroidRuntime(556): at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1119)
11-27 13:24:08.628: ERROR/AndroidRuntime(556): at android.widget.LinearLayout.layoutHorizontal(LinearLayout.java:1108)
11-27 13:24:08.628: ERROR/AndroidRuntime(556): at android.widget.TableRow.onLayout(TableRow.java:121)
11-27 13:24:08.628: ERROR/AndroidRuntime(556): at android.view.View.layout(View.java:6830)
11-27 13:24:08.628: ERROR/AndroidRuntime(556): at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1119)
11-27 13:24:08.628: ERROR/AndroidRuntime(556): at android.widget.LinearLayout.layoutVertical(LinearLayout.java:998)
11-27 13:24:08.628: ERROR/AndroidRuntime(556): at android.widget.TableLayout.onLayout(TableLayout.java:437)
11-27 13:24:08.628: ERROR/AndroidRuntime(556): at android.view.View.layout(View.java:6830)
11-27 13:24:08.628: ERROR/AndroidRuntime(556): at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1119)
11-27 13:24:08.628: ERROR/AndroidRuntime(556): at android.widget.LinearLayout.layoutVertical(LinearLayout.java:998)
11-27 13:24:08.628: ERROR/AndroidRuntime(556): at android.widget.LinearLayout.onLayout(LinearLayout.java:918)
11-27 13:24:08.628: ERROR/AndroidRuntime(556): at android.view.View.layout(View.java:6830)
11-27 13:24:08.628: ERROR/AndroidRuntime(556): at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1119)
11-27 13:24:08.628: ERROR/AndroidRuntime(556): at android.widget.LinearLayout.layoutVertical(LinearLayout.java:998)
11-27 13:24:08.628: ERROR/AndroidRuntime(556): at android.widget.LinearLayout.onLayout(LinearLayout.java:918)
11-27 13:24:08.628: ERROR/AndroidRuntime(556): at android.view.View.layout(View.java:6830)
11-27 13:24:08.628: ERROR/AndroidRuntime(556): at android.widget.FrameLayout.onLayout(FrameLayout.java:333)
11-27 13:24:08.628: ERROR/AndroidRuntime(556): at android.view.View.layout(View.java:6830)
11-27 13:24:08.628: ERROR/AndroidRuntime(556): at android.widget.FrameLayout.onLayout(FrameLayout.java:333)
11-27 13:24:08.628: ERROR/AndroidRuntime(556): at android.view.View.layout(View.java:6830)
11-27 13:24:08.628: ERROR/AndroidRuntime(556): at android.view.ViewRoot.performTraversals(ViewRoot.java:996)
11-27 13:24:08.628: ERROR/AndroidRuntime(556): at android.view.ViewRoot.handleMessage(ViewRoot.java:1633)
11-27 13:24:08.628: ERROR/AndroidRuntime(556): at android.os.Handler.dispatchMessage(Handler.java:99)
11-27 13:24:08.628: ERROR/AndroidRuntime(556): at android.os.Looper.loop(Looper.java:123)
11-27 13:24:08.628: ERROR/AndroidRuntime(556): at android.app.ActivityThread.main(ActivityThread.java:4363)
11-27 13:24:08.628: ERROR/AndroidRuntime(556): at java.lang.reflect.Method.invokeNative(Native Method)
11-27 13:24:08.628: ERROR/AndroidRuntime(556): at java.lang.reflect.Method.invoke(Method.java:521)
11-27 13:24:08.628: ERROR/AndroidRuntime(556): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
11-27 13:24:08.628: ERROR/AndroidRuntime(556): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
11-27 13:24:08.628: ERROR/AndroidRuntime(556): at dalvik.system.NativeStart.main(Native Method)
As I can't still comment I'll put it as an answer, though it might now solve your problem.
I had the same issue when showing images in a listview that were downloaded in an asynchronous thread and it happened the same when clicking in an item (and by so opening other activity) and immediately pressing the back, thus returning to the ListActivity.
So what I made to (apparently) solve the issue was to hide the list when stopping the activity and showing the list again when going back to it.
#Override
protected void onStop() {
super.onStop();
getListView().setVisibility(View.GONE);
}
#Override
protected void onRestart() {
super.onRestart();
getListView().setVisibility(View.VISIBLE);
}
Quite simple, huh?
Hope it helps you.

Categories

Resources