This question already has answers here:
Your content must have a ListView whose id attribute is 'android.R.id.list'
(7 answers)
Closed 7 years ago.
LogCat
06-02 15:53:34.742: E/Trace(1188): error opening trace file: No such file or directory (2)
06-02 15:53:36.682: D/dalvikvm(1188): GC_FOR_ALLOC freed 49K, 7% free 2539K/2708K, paused 483ms, total 484ms
06-02 15:53:36.712: I/dalvikvm-heap(1188): Grow heap (frag case) to 3.666MB for 1127536-byte allocation
06-02 15:53:36.782: D/dalvikvm(1188): GC_FOR_ALLOC freed 1K, 5% free 3639K/3812K, paused 69ms, total 69ms
06-02 15:53:36.902: D/dalvikvm(1188): GC_CONCURRENT freed <1K, 5% free 3639K/3812K, paused 15ms+42ms, total 123ms
06-02 15:53:37.672: I/Choreographer(1188): Skipped 49 frames! The application may be doing too much work on its main thread.
06-02 15:53:37.705: D/gralloc_goldfish(1188): Emulator without GPU emulation detected.
06-02 15:53:40.412: D/AndroidRuntime(1188): Shutting down VM
06-02 15:53:40.412: W/dalvikvm(1188): threadid=1: thread exiting with uncaught exception (group=0x40a71930)
06-02 15:53:40.612: E/AndroidRuntime(1188): FATAL EXCEPTION: main
06-02 15:53:40.612: E/AndroidRuntime(1188): java.lang.RuntimeException: Unable to start activity ComponentInfo{testing.android.application.three/testing.android.application.three.MainActivityNext}: java.lang.RuntimeException: Your content must have a ListView whose id attribute is 'android.R.id.list'
06-02 15:53:40.612: E/AndroidRuntime(1188): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180)
06-02 15:53:40.612: E/AndroidRuntime(1188): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
06-02 15:53:40.612: E/AndroidRuntime(1188): at android.app.ActivityThread.access$600(ActivityThread.java:141)
06-02 15:53:40.612: E/AndroidRuntime(1188): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
06-02 15:53:40.612: E/AndroidRuntime(1188): at android.os.Handler.dispatchMessage(Handler.java:99)
06-02 15:53:40.612: E/AndroidRuntime(1188): at android.os.Looper.loop(Looper.java:137)
06-02 15:53:40.612: E/AndroidRuntime(1188): at android.app.ActivityThread.main(ActivityThread.java:5041)
06-02 15:53:40.612: E/AndroidRuntime(1188): at java.lang.reflect.Method.invokeNative(Native Method)
06-02 15:53:40.612: E/AndroidRuntime(1188): at java.lang.reflect.Method.invoke(Method.java:511)
06-02 15:53:40.612: E/AndroidRuntime(1188): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
06-02 15:53:40.612: E/AndroidRuntime(1188): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
06-02 15:53:40.612: E/AndroidRuntime(1188): at dalvik.system.NativeStart.main(Native Method)
06-02 15:53:40.612: E/AndroidRuntime(1188): Caused by: java.lang.RuntimeException: Your content must have a ListView whose id attribute is 'android.R.id.list'
06-02 15:53:40.612: E/AndroidRuntime(1188): at android.app.ListActivity.onContentChanged(ListActivity.java:243)
06-02 15:53:40.612: E/AndroidRuntime(1188): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:273)
06-02 15:53:40.612: E/AndroidRuntime(1188): at android.app.Activity.setContentView(Activity.java:1881)
06-02 15:53:40.612: E/AndroidRuntime(1188): at testing.android.application.three.MainActivityNext.onCreate(MainActivityNext.java:28)
06-02 15:53:40.612: E/AndroidRuntime(1188): at android.app.Activity.performCreate(Activity.java:5104)
06-02 15:53:40.612: E/AndroidRuntime(1188): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
06-02 15:53:40.612: E/AndroidRuntime(1188): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
06-02 15:53:40.612: E/AndroidRuntime(1188): ... 11 more
06-02 15:53:44.662: I/Process(1188): Sending signal. PID: 1188 SIG: 9
Your problem is you are trying to extends ListActivity and you don't have a ListView with
android:id="android.R.id.list"
You need to have a ListView in your xml with that id. Please add it to your xml
You can tell by the following line in your logcat
Caused by: java.lang.RuntimeException: Your content must have a ListView whose id attribute is 'android.R.id.list'
If you find the next line that references your Activity it will tell you the class and line number
at testing.android.application.three.MainActivityNext.onCreate(MainActivityNext.java:28)
So MainActivityNext line 28 is showing the exception.
Note
As stated in a comment, please don't just post unformatted logcat when asking for help. Please try to look for where the error is occurring and post relevant code along with a description of what the problem is. This one was easy to see from the error but usually we will need to see some code
You can use CTRL+K to format your code and logcat or use the coding brackets above {}
You have defined a ListViewActivity (I guess), but it doesn't have a #android:id/list. You should change the ID of your ListView like this:
<ListView
android:id="#android:id/list"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
</ListView>
Related
yesterday one of our customers reported that our app crashes on his Xperia Z1 with Android 4.4.2. After testing in an avd, we found out, that this exception doesn't happen on API 18 or earlier. The app crashes after the Dialog is returned but the reason seems to be the AlertDialog.setView because if we remove this line, the app doesn't crash.
I already spent quite some time searching the web for a solution and trying different approaches but didn't find anything that's helping me.
Are there any known problems with API 19 and AlertDialog.setView? Are we doing something wrong? Does someone have an idea how to solve this?
Thanks in advance
Dirk
This is the (simplified, but still crashing) code i'm creating the dialog with:
AlertDialog alert = null;
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setCancelable(false).setPositiveButton("OK",
new DialogInterface.OnClickListener()
{
...
});
builder.setNeutralButton(
getResources().getString(R.string.text_button_help),
new DialogInterface.OnClickListener()
{
...
});
builder.setView(this.getLayoutInflater().inflate(R.layout.timeline,
null));
alert = builder.create();
return alert;
And the LogCat output:
06-11 06:44:25.710: E/ViewRootImpl(1188): Attempting to destroy the window while drawing!
06-11 06:44:25.710: E/ViewRootImpl(1188): window=android.view.ViewRootImpl#b237f958, title=foo/bar
06-11 06:44:25.820: W/dalvikvm(1188): threadid=1: thread exiting with uncaught exception (group=0xb1a3aba8)
06-11 06:44:25.840: E/AndroidRuntime(1188): FATAL EXCEPTION: main
06-11 06:44:25.840: E/AndroidRuntime(1188): Process: foo, PID: 1188
06-11 06:44:25.840: E/AndroidRuntime(1188): java.lang.IllegalStateException: Surface has already been released.
06-11 06:44:25.840: E/AndroidRuntime(1188): at android.view.Surface.checkNotReleasedLocked(Surface.java:408)
06-11 06:44:25.840: E/AndroidRuntime(1188): at android.view.Surface.unlockCanvasAndPost(Surface.java:261)
06-11 06:44:25.840: E/AndroidRuntime(1188): at android.view.ViewRootImpl.drawSoftware(ViewRootImpl.java:2507)
06-11 06:44:25.840: E/AndroidRuntime(1188): at android.view.ViewRootImpl.draw(ViewRootImpl.java:2409)
06-11 06:44:25.840: E/AndroidRuntime(1188): at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2253)
06-11 06:44:25.840: E/AndroidRuntime(1188): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1883)
06-11 06:44:25.840: E/AndroidRuntime(1188): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1000)
06-11 06:44:25.840: E/AndroidRuntime(1188): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5670)
06-11 06:44:25.840: E/AndroidRuntime(1188): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:761)
06-11 06:44:25.840: E/AndroidRuntime(1188): at android.view.Choreographer.doCallbacks(Choreographer.java:574)
06-11 06:44:25.840: E/AndroidRuntime(1188): at android.view.Choreographer.doFrame(Choreographer.java:544)
06-11 06:44:25.840: E/AndroidRuntime(1188): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747)
06-11 06:44:25.840: E/AndroidRuntime(1188): at android.os.Handler.handleCallback(Handler.java:733)
06-11 06:44:25.840: E/AndroidRuntime(1188): at android.os.Handler.dispatchMessage(Handler.java:95)
06-11 06:44:25.840: E/AndroidRuntime(1188): at android.os.Looper.loop(Looper.java:136)
06-11 06:44:25.840: E/AndroidRuntime(1188): at android.app.ActivityThread.main(ActivityThread.java:5017)
06-11 06:44:25.840: E/AndroidRuntime(1188): at java.lang.reflect.Method.invokeNative(Native Method)
06-11 06:44:25.840: E/AndroidRuntime(1188): at java.lang.reflect.Method.invoke(Method.java:515)
06-11 06:44:25.840: E/AndroidRuntime(1188): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
06-11 06:44:25.840: E/AndroidRuntime(1188): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
06-11 06:44:25.840: E/AndroidRuntime(1188): at dalvik.system.NativeStart.main(Native Method)
we finally figured it out by ourselves, at least how we get it to work. the problem has been that we were still using the deprecated showDialog()-method instead of DialogFragments. It seems there are cases in which showDialog() and AlertDialog.setView() don't work together, in other cases they obviously do, we had another dialog which was still working. After introducing DialogFragments to our app the dialog starts just like in previous API-versions.
I am working on android application, My application is crashing saying this message
'Unfortunately process "iTextSharpGeneric.ITextSharp" has stopped' when i am navigating form other application to my application. iTextSharpGeneric is my projoect name.
i found this excpetion in Adnroid device logging window:-
"java.lang.RunttimeException: Unable to instantiate activity ComponentInfo{com.iTextSharpGenericTest/iTextSharpGenericTest..TestActivity2}.java.lang.ClassNotFoundException"
Here is the scenari i am doing. In my application
ITextSharpGeneric--> Opening a pdf(using adobe reader)-> After Editing pdf In Adobe reader-> Selecting Share option-> Showing list of application-> I am selecting "iTextSharpGeneric" n the list of applications(to save that edited pdf details)-> "Application Crashes here"
I tried using the save OnSaveInstanceState() and OnRestoreInstanceState() for retaining the acitivity state. But still getting the same issue.
Here is my intent filters tags in AndroidManifest.xml
activity android:name="com.iTextSharpGenericTest.Activity2" android:label="iTextSharp"
intent-filter
action android:name="android.intent.action.MAIN"
action android:name="android.intent.action.SEND"
action android:name="android.intent.action.VIEW"
category android:name="android.intent.category.DEFAULT"
category android:name="android.intent.category.BROWSABLE"
data android:mimeType="application/pdf"
intent-filter
activity
What's wrong i am doing? Let me know you valueble suggesstions.
Here is the detailed log of exception, I just selected filter option"Android Runtime" in Android Device Logging Window.
02-21 14:31:33.000 E/AndroidRuntime( 5614): FATAL EXCEPTION: main
02-21 14:31:33.000 E/AndroidRuntime( 5614): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.iTextSharpGenericTest/iTextSharpGenericTest.Activity2}: java.lang.ClassNotFoundException: iTextSharpGenericTest.Activity2
02-21 14:31:33.000 E/AndroidRuntime( 5614): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1884)
02-21 14:31:33.000 E/AndroidRuntime( 5614): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1985)
02-21 14:31:33.000 E/AndroidRuntime( 5614): at android.app.ActivityThread.access$600(ActivityThread.java:127)
02-21 14:31:33.000 E/AndroidRuntime( 5614): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1151)
02-21 14:31:33.000 E/AndroidRuntime( 5614): at android.os.Handler.dispatchMessage(Handler.java:99)
02-21 14:31:33.000 E/AndroidRuntime( 5614): at android.os.Looper.loop(Looper.java:137)
02-21 14:31:33.000 E/AndroidRuntime( 5614): at android.app.ActivityThread.main(ActivityThread.java:4447)
02-21 14:31:33.000 E/AndroidRuntime( 5614): at java.lang.reflect.Method.invokeNative(Native Method)
02-21 14:31:33.000 E/AndroidRuntime( 5614): at java.lang.reflect.Method.invoke(Method.java:511)
02-21 14:31:33.000 E/AndroidRuntime( 5614): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
02-21 14:31:33.000 E/AndroidRuntime( 5614): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
02-21 14:31:33.000 E/AndroidRuntime( 5614): at dalvik.system.NativeStart.main(Native Method)
02-21 14:31:33.000 E/AndroidRuntime( 5614): Caused by: java.lang.ClassNotFoundException: iTextSharpGenericTest.Activity2
02-21 14:31:33.000 E/AndroidRuntime( 5614): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
02-21 14:31:33.000 E/AndroidRuntime( 5614): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
02-21 14:31:33.000 E/AndroidRuntime( 5614): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
02-21 14:31:33.000 E/AndroidRuntime( 5614): at android.app.Instrumentation.newActivity(Instrumentation.java:1066)
02-21 14:31:33.000 E/AndroidRuntime( 5614): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1875)
02-21 14:31:33.000 E/AndroidRuntime( 5614): ... 11 more
02-21 14:31:33.010 W/ActivityManager( 169): Force finishing activity com.iTextSharpGenericTest/iTextSharpGenericTest.Activity2
02-21 14:31:33.520 W/ActivityManager( 169): Activity pause timeout for ActivityRecord{4163ed28 com.iTextSharpGenericTest/iTextSharpGenericTest.Activity2}
02-21 14:31:33.650 D/OpenGLRenderer( 5215): Flushing caches (mode 0)
02-21 14:31:43.820 W/ActivityManager( 169): Activity destroy timeout for ActivityRecord{4163ed28 com.iTextSharpGenericTest/iTextSharpGenericTest.Activity2}
02-21 14:31:46.360 I/Process ( 5614): Sending signal. PID: 5614 SIG: 9
02-21 14:31:46.380 W/InputDispatcher( 169): channel '414cb888 com.iTextSharpGenericTest/itextsharpgenerictest.Activity1 (server)' ~ Consumer closed input channel or an error occurred. events=0x8
02-21 14:31:46.380 E/InputDispatcher( 169): channel '414cb888 com.iTextSharpGenericTest/itextsharpgenerictest.Activity1 (server)' ~ Channel is unrecoverably broken and will be disposed!
02-21 14:31:46.380 W/InputDispatcher( 169): Attempted to unregister already unregistered input channel '414cb888 com.iTextSharpGenericTest/itextsharpgenerictest.Activity1 (server)'
02-21 14:31:46.380 I/ActivityManager( 169): Process com.iTextSharpGenericTest (pid 5614) has died.
02-21 14:31:46.380 V/TabletStatusBar( 250): setLightsOn(true)
02-21 14:31:46.380 I/WindowManager( 169): WIN DEATH: Window{414cb888 com.iTextSharpGenericTest/itextsharpgenerictest.Activity1 paused=false}
02-21 14:31:46.390 I/WindowManager( 169): WINDOW DIED Window{414cb888 com.iTextSharpGenericTest/itextsharpgenerictest.Activity1 paused=false}
02-21 14:31:46.630 D/AndroidRuntime( 5645):
02-21 14:31:46.630 D/AndroidRuntime( 5645): >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
02-21 14:31:46.630 D/AndroidRuntime( 5645): CheckJNI is OFF
02-21 14:31:46.870 D/AndroidRuntime( 5645): Calling main entry com.android.commands.am.Am
02-21 14:31:46.880 D/AndroidRuntime( 5645): Shutting down VM
02-21 14:31:46.880 I/AndroidRuntime( 5645): NOTE: attach of thread 'Binder Thread #3' failed
02-21 14:31:46.880 I/ActivityManager( 169): Force stopping package com.iTextSharpGenericTest uid=10086
02-21 14:31:46.880 I/ActivityManager( 169): Force finishing activity ActivityRecord{41291510 com.iTextSharpGenericTest/itextsharpgenerictest.Activity1}
02-21 14:31:46.890 D/dalvikvm( 5645): GC_CONCURRENT freed 96K, 83% free 450K/2560K, paused 1ms+0ms
02-21 14:32:29.770 D/dalvikvm( 250): GC_CONCURRENT freed 422K, 73% free 8194K/30151K, paused 2ms
Thanks
Sreeni
"iTextSharpGenericTest..TestActivity2}"
As you can see, you are actually passing your Intentfilter for you class wrong. There are 2 dots between iTextSharpGenericTest and TestActivity2.
May be that's the case why it is not able to detect your TestActivity2 class and hence throwing that error java.lang.ClassNotFoundException.
Hope this helps.
My app runs fine on phone crashes on start up on tablets. It runs fine on my phone running 2.3.7 and my sister's phone running 4.0.3. But it crashes on my 10.1" tablet running 4.0.4. I tried it on a Nexus 7 AVD running 4.2 and it crashes there too.
This is the Log
12-26 23:11:55.350: E/Trace(845): error opening trace file: No such file or directory (2)
12-26 23:11:55.350: W/Trace(845): Unexpected value from nativeGetEnabledTags: 0
12-26 23:11:55.350: W/Trace(845): Unexpected value from nativeGetEnabledTags: 0
12-26 23:11:55.350: W/Trace(845): Unexpected value from nativeGetEnabledTags: 0
12-26 23:11:55.560: W/Trace(845): Unexpected value from nativeGetEnabledTags: 0
12-26 23:11:55.560: W/Trace(845): Unexpected value from nativeGetEnabledTags: 0
12-26 23:11:56.741: D/dalvikvm(845): GC_CONCURRENT freed 217K, 12% free 2635K/2984K, paused 70ms+14ms, total 139ms
12-26 23:11:56.751: D/dalvikvm(845): WAIT_FOR_CONCURRENT_GC blocked 4ms
12-26 23:11:56.813: D/dalvikvm(845): GC_FOR_ALLOC freed 68K, 14% free 2666K/3084K, paused 52ms, total 53ms
12-26 23:11:56.821: I/dalvikvm-heap(845): Grow heap (frag case) to 3.333MB for 635812-byte allocation
12-26 23:11:56.881: D/dalvikvm(845): GC_FOR_ALLOC freed <1K, 12% free 3286K/3708K, paused 57ms, total 57ms
12-26 23:11:56.931: D/dalvikvm(845): GC_CONCURRENT freed <1K, 12% free 3287K/3708K, paused 9ms+3ms, total 52ms
12-26 23:11:56.931: D/dalvikvm(845): WAIT_FOR_CONCURRENT_GC blocked 12ms
12-26 23:11:56.931: I/dalvikvm-heap(845): Grow heap (frag case) to 3.811MB for 500416-byte allocation
12-26 23:11:57.011: D/dalvikvm(845): GC_FOR_ALLOC freed <1K, 11% free 3775K/4200K, paused 49ms, total 49ms
12-26 23:11:57.223: D/AndroidRuntime(845): Shutting down VM
12-26 23:11:57.223: W/dalvikvm(845): threadid=1: thread exiting with uncaught exception (group=0x40a70930)
12-26 23:11:57.231: E/AndroidRuntime(845): FATAL EXCEPTION: main
12-26 23:11:57.231: E/AndroidRuntime(845): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.brandsonicinc.brandsonic.web.mobile/com.brandsonicinc.brandsonic.web.mobile.MainActivity}: java.lang.NullPointerException
12-26 23:11:57.231: E/AndroidRuntime(845): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180)
12-26 23:11:57.231: E/AndroidRuntime(845): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
12-26 23:11:57.231: E/AndroidRuntime(845): at android.app.ActivityThread.access$600(ActivityThread.java:141)
12-26 23:11:57.231: E/AndroidRuntime(845): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
12-26 23:11:57.231: E/AndroidRuntime(845): at android.os.Handler.dispatchMessage(Handler.java:99)
12-26 23:11:57.231: E/AndroidRuntime(845): at android.os.Looper.loop(Looper.java:137)
12-26 23:11:57.231: E/AndroidRuntime(845): at android.app.ActivityThread.main(ActivityThread.java:5039)
12-26 23:11:57.231: E/AndroidRuntime(845): at java.lang.reflect.Method.invokeNative(Native Method)
12-26 23:11:57.231: E/AndroidRuntime(845): at java.lang.reflect.Method.invoke(Method.java:511)
12-26 23:11:57.231: E/AndroidRuntime(845): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
12-26 23:11:57.231: E/AndroidRuntime(845): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
12-26 23:11:57.231: E/AndroidRuntime(845): at dalvik.system.NativeStart.main(Native Method)
12-26 23:11:57.231: E/AndroidRuntime(845): Caused by: java.lang.NullPointerException
12-26 23:11:57.231: E/AndroidRuntime(845): at com.brandsonicinc.brandsonic.web.mobile.MainActivity.onCreate(MainActivity.java:84)
12-26 23:11:57.231: E/AndroidRuntime(845): at android.app.Activity.performCreate(Activity.java:5104)
12-26 23:11:57.231: E/AndroidRuntime(845): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
12-26 23:11:57.231: E/AndroidRuntime(845): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
12-26 23:11:57.231: E/AndroidRuntime(845): ... 11 more
12-26 23:12:02.487: W/chromium(845): external/chromium/net/disk_cache/backend_impl.cc:1835: [1226/231202:WARNING:backend_impl.cc(1835)] Destroying invalid entry.
12-26 23:12:02.500: E/chromium(845): external/chromium/net/disk_cache/backend_impl.cc:1107: [1226/231202:ERROR:backend_impl.cc(1107)] Critical error found -8
12-26 23:12:02.820: W/chromium(845): external/chromium/net/disk_cache/storage_block-inl.h:119: [1226/231202:WARNING:storage_block-inl.h(119)] Failed data load.
12-26 23:12:02.820: W/chromium(845): external/chromium/net/disk_cache/storage_block-inl.h:119: [1226/231202:WARNING:storage_block-inl.h(119)] Failed data load.
12-26 23:12:02.840: W/chromium(845): external/chromium/net/disk_cache/storage_block-inl.h:119: [1226/231202:WARNING:storage_block-inl.h(119)] Failed data load.
12-26 23:12:02.881: W/chromium(845): external/chromium/net/disk_cache/storage_block-inl.h:119: [1226/231202:WARNING:storage_block-inl.h(119)] Failed data load.
12-26 23:12:02.966: E/chromium(845): external/chromium/net/disk_cache/entry_impl.cc:904: [1226/231202:ERROR:entry_impl.cc(904)] Failed to save user data
12-26 23:12:02.971: E/chromium(845): external/chromium/net/disk_cache/entry_impl.cc:904: [1226/231202:ERROR:entry_impl.cc(904)] Failed to save user data
12-26 23:12:04.361: I/Process(845): Sending signal. PID: 845 SIG: 9
Please help this is very frustrating. It used to run fine on tablets. Could it have something to do with the layouts?
try to put all your xml files in layout folder and no need to remove it from other if it already there.
If xml files are in folders like layout-sw600dp then the device will fail to load the specified xml file if screen width is less than 600dp. this is just example in your case it may be different
I have read your log, there is a bug on finding directory, have you use some directory method, to retrieve file from a particular location, tablet have internal storage instead of sd card might be problem in that.
But I can better understand if you post the code.
I have several methods for getting a record in my app
But for some reason this one keeps giving me FC !
I'm using the following method to get the Cursor :
Cursor c=helper.getRecordById(num);
Which is implemented as follows :
public Cursor getRecordById(int rowId) {
String rowIDs=""+rowId;
String SelectById = "SELECT id, OrderName, OrderLink, DateYear, DateMonth, DateDay, OrderPrice FROM Orders WHERE id=?";
String[] args={rowIDs};
return(getReadableDatabase().rawQuery(SelectById, args));
}
I have tried also without converting the Int to String but i just left it this way.. get the same error for both ways.
Whenever i get to the following line :
String name=c.getString(c.getColumnIndexOrThrow("OrderName"));
I get the FC.
The GetColumnIndex works just fine... i've tested it exclusively.
But the getString throws the error. :
06-02 21:07:13.656: W/KeyCharacterMap(4329): Using default keymap: /system/usr/keychars/qwerty.kcm.bin
06-02 21:07:16.006: D/AndroidRuntime(4329): Shutting down VM
06-02 21:07:16.006: W/dalvikvm(4329): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
06-02 21:07:16.026: E/AndroidRuntime(4329): FATAL EXCEPTION: main
06-02 21:07:16.026: E/AndroidRuntime(4329): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.Sagi.MyOrders/com.Sagi.MyOrders.DisplayRecord}: android.database.CursorIndexOutOfBoundsException: Index -1 requested, with a size of 0
06-02 21:07:16.026: E/AndroidRuntime(4329): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
06-02 21:07:16.026: E/AndroidRuntime(4329): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
06-02 21:07:16.026: E/AndroidRuntime(4329): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
06-02 21:07:16.026: E/AndroidRuntime(4329): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
06-02 21:07:16.026: E/AndroidRuntime(4329): at android.os.Handler.dispatchMessage(Handler.java:99)
06-02 21:07:16.026: E/AndroidRuntime(4329): at android.os.Looper.loop(Looper.java:123)
06-02 21:07:16.026: E/AndroidRuntime(4329): at android.app.ActivityThread.main(ActivityThread.java:4627)
06-02 21:07:16.026: E/AndroidRuntime(4329): at java.lang.reflect.Method.invokeNative(Native Method)
06-02 21:07:16.026: E/AndroidRuntime(4329): at java.lang.reflect.Method.invoke(Method.java:521)
06-02 21:07:16.026: E/AndroidRuntime(4329): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
06-02 21:07:16.026: E/AndroidRuntime(4329): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
06-02 21:07:16.026: E/AndroidRuntime(4329): at dalvik.system.NativeStart.main(Native Method)
06-02 21:07:16.026: E/AndroidRuntime(4329): Caused by: android.database.CursorIndexOutOfBoundsException: Index -1 requested, with a size of 0
06-02 21:07:16.026: E/AndroidRuntime(4329): at android.database.AbstractCursor.checkPosition(AbstractCursor.java:580)
06-02 21:07:16.026: E/AndroidRuntime(4329): at android.database.AbstractWindowedCursor.checkPosition(AbstractWindowedCursor.java:214)
06-02 21:07:16.026: E/AndroidRuntime(4329): at android.database.AbstractWindowedCursor.getString(AbstractWindowedCursor.java:41)
06-02 21:07:16.026: E/AndroidRuntime(4329): at com.Sagi.MyOrders.DisplayRecord.onCreate(DisplayRecord.java:48)
06-02 21:07:16.026: E/AndroidRuntime(4329): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
06-02 21:07:16.026: E/AndroidRuntime(4329): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
06-02 21:07:16.026: E/AndroidRuntime(4329): ... 11 more
06-02 21:12:16.126: I/Process(4329): Sending signal. PID: 4329 SIG: 9
The funny thing is i copied the same exact Lookup method i used in another place which works just fine !, i even tried giving it a constant to look for which i know to exists just to check. but nothing. error over and over again !
Thanks !!!
A Cursor initially points to a record one before the start, to allow this kind of code:
final Cursor cursor = /* get cursor */;
while(cursor.moveToNext()) {
/* do something with cursor */
}
If you are only expecting one record, and you are sure there will be one record, then before accesing your Cursor do:
cursor.moveToNext();
or:
cursor.moveToFirst();
in past i worked with my projects and everything was good. but recently, i have this errors:
06-02 04:52:27.954: W/dalvikvm(344): Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Lcom/badlogic/gdx/backends/android/AndroidApplication;
06-02 04:52:27.954: W/dalvikvm(344): Class init failed in newInstance call (Lcom/Jumper/ProjectAndroidActivity;)
06-02 04:52:27.963: D/AndroidRuntime(344): Shutting down VM
06-02 04:52:27.963: W/dalvikvm(344): threadid=1: thread exiting with uncaught exception (group=0x40015560)
06-02 04:52:27.993: E/AndroidRuntime(344): FATAL EXCEPTION: main
06-02 04:52:27.993: E/AndroidRuntime(344): java.lang.ExceptionInInitializerError
06-02 04:52:27.993: E/AndroidRuntime(344): at java.lang.Class.newInstanceImpl(Native Method)
06-02 04:52:27.993: E/AndroidRuntime(344): at java.lang.Class.newInstance(Class.java:1409)
06-02 04:52:27.993: E/AndroidRuntime(344): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
06-02 04:52:27.993: E/AndroidRuntime(344): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1561)
06-02 04:52:27.993: E/AndroidRuntime(344): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
06-02 04:52:27.993: E/AndroidRuntime(344): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
06-02 04:52:27.993: E/AndroidRuntime(344): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
06-02 04:52:27.993: E/AndroidRuntime(344): at android.os.Handler.dispatchMessage(Handler.java:99)
06-02 04:52:27.993: E/AndroidRuntime(344): at android.os.Looper.loop(Looper.java:123)
06-02 04:52:27.993: E/AndroidRuntime(344): at android.app.ActivityThread.main(ActivityThread.java:3683)
06-02 04:52:27.993: E/AndroidRuntime(344): at java.lang.reflect.Method.invokeNative(Native Method)
06-02 04:52:27.993: E/AndroidRuntime(344): at java.lang.reflect.Method.invoke(Method.java:507)
06-02 04:52:27.993: E/AndroidRuntime(344): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
06-02 04:52:27.993: E/AndroidRuntime(344): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
06-02 04:52:27.993: E/AndroidRuntime(344): at dalvik.system.NativeStart.main(Native Method)
06-02 04:52:27.993: E/AndroidRuntime(344): Caused by: java.lang.UnsatisfiedLinkError: Couldn't load gdx: findLibrary returned null
06-02 04:52:27.993: E/AndroidRuntime(344): at java.lang.Runtime.loadLibrary(Runtime.java:429)
06-02 04:52:27.993: E/AndroidRuntime(344): at java.lang.System.loadLibrary(System.java:554)
06-02 04:52:27.993: E/AndroidRuntime(344): at com.badlogic.gdx.utils.GdxNativesLoader.load(GdxNativesLoader.java:116)
06-02 04:52:27.993: E/AndroidRuntime(344): at com.badlogic.gdx.backends.android.AndroidApplication.<clinit>(AndroidApplication.java:59)
06-02 04:52:27.993: E/AndroidRuntime(344): ... 15 more
i think this errors are from my libs. but i change them with new ones. is there any solution for it?
This error occurs when the armeabi and armeabi-v7a directories cannot be found. Copy both of these directories and their contents into the libs directory of your project.
It should look something like this:
you copied the wrong .so files in the folders. I assume you extracted them from gdx-natives.jar. Instead directly copy the armeabi and armeabi-v7a folders from the release/nightly. Make sure to use jars and natives only from a single release, do not mix jars and natives from multiple releases.
Alternatively use the gdx-setup-ui, as described here http://code.google.com/p/libgdx/wiki/ProjectSetupNew
I got that same error on my VM and other emulators, and found it was because they ran x86 O/S'es, which libgdx does not support.
If it doesn't work on the device either, try this:
android-project -> properties -> java Build Path -> Order and Export.
Click the project you've linked to (your plain java-project or desktop-project) and click the "Up"-button until it is at the very top. Make sure it's ticked [V].
I did that with the jars too, just in case, and now it runs on my device. I still get that same error on my x86 VM, because libgdx does not support x86 Android devices.