I have a listview that consists of two textviews. One for dates, one for names.
Config.xml includes the listview:
<ListView android:id="#+id/ListView01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/linlay">
</ListView>
Row.xml includes the two textviews:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:paddingTop="4dip"
android:paddingBottom="6dip"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout android:orientation="horizontal"
android:id="#+id/linlay"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TextView android:id="#+id/left"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<TextView android:id="#+id/right"
android:layout_width="wrap_content"
android:layout_height="fill_parent"/>
</LinearLayout>
</LinearLayout>
I have two more buttons to change the content of the textviews with each other but as the content of the first one (initially) is wider than the second one, i need to set the width of the layout in the code.
Unfortunately there is no txt.setLayoutWidth or similar command, and txt.setWidth() is not working.
I need something like this in this code:
Button sortname = (Button)findViewById(R.id.Button02);
sortname.setOnClickListener(new View.OnClickListener()
{
public void onClick(View v)
{
lv1.setAdapter(simpleAdapter2);
LinearLayout.LayoutParams layoutparams = new LinearLayout.LayoutParams(200,120);
txt1.setLayoutParams(layoutparams);
}
});
This two rows makes the app freeze (stopped unexpectedly):
LinearLayout.LayoutParams layoutparams = new LinearLayout.LayoutParams(200,120);
txt1.setLayoutParams(layoutparams);
Logcat:
02-05 22:58:11.040: INFO/ActivityManager(58): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.bfarago.nevnap/.MainActivity }
02-05 22:58:11.210: DEBUG/AndroidRuntime(415): Shutting down VM
02-05 22:58:11.230: DEBUG/dalvikvm(415): Debugger has detached; object registry had 1 entries
02-05 22:58:11.330: INFO/AndroidRuntime(415): NOTE: attach of thread 'Binder Thread #3' failed
02-05 22:58:12.310: INFO/ActivityManager(58): Displayed activity com.bfarago.nevnap/.MainActivity: 1108 ms (total 1108 ms)
02-05 22:58:17.560: DEBUG/dalvikvm(125): GC_EXPLICIT freed 1274 objects / 73520 bytes in 185ms
02-05 22:58:17.660: DEBUG/AndroidRuntime(405): Shutting down VM
02-05 22:58:17.660: WARN/dalvikvm(405): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
02-05 22:58:17.670: ERROR/AndroidRuntime(405): FATAL EXCEPTION: main
02-05 22:58:17.670: ERROR/AndroidRuntime(405): java.lang.NullPointerException
02-05 22:58:17.670: ERROR/AndroidRuntime(405): at com.bfarago.nevnap.MainActivity$2.onClick(MainActivity.java:129)
02-05 22:58:17.670: ERROR/AndroidRuntime(405): at android.view.View.performClick(View.java:2408)
02-05 22:58:17.670: ERROR/AndroidRuntime(405): at android.view.View$PerformClick.run(View.java:8816)
02-05 22:58:17.670: ERROR/AndroidRuntime(405): at android.os.Handler.handleCallback(Handler.java:587)
02-05 22:58:17.670: ERROR/AndroidRuntime(405): at android.os.Handler.dispatchMessage(Handler.java:92)
02-05 22:58:17.670: ERROR/AndroidRuntime(405): at android.os.Looper.loop(Looper.java:123)
02-05 22:58:17.670: ERROR/AndroidRuntime(405): at android.app.ActivityThread.main(ActivityThread.java:4627)
02-05 22:58:17.670: ERROR/AndroidRuntime(405): at java.lang.reflect.Method.invokeNative(Native Method)
02-05 22:58:17.670: ERROR/AndroidRuntime(405): at java.lang.reflect.Method.invoke(Method.java:521)
02-05 22:58:17.670: ERROR/AndroidRuntime(405): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
02-05 22:58:17.670: ERROR/AndroidRuntime(405): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
02-05 22:58:17.670: ERROR/AndroidRuntime(405): at dalvik.system.NativeStart.main(Native Method)
02-05 22:58:17.680: WARN/ActivityManager(58): Force finishing activity com.bfarago.nevnap/.MainActivity
02-05 22:58:18.200: WARN/ActivityManager(58): Activity pause timeout for HistoryRecord{43e9a940 com.bfarago.nevnap/.MainActivity}
02-05 22:58:19.790: INFO/Process(405): Sending signal. PID: 405 SIG: 9
02-05 22:58:19.820: INFO/ActivityManager(58): Process com.bfarago.nevnap (pid 405) has died.
02-05 22:58:19.820: WARN/ActivityManager(58): Scheduling restart of crashed service com.bfarago.nevnap/.UpdateService in 5000ms
02-05 22:58:19.820: INFO/WindowManager(58): WIN DEATH: Window{43fce1d8 com.bfarago.nevnap/com.bfarago.nevnap.MainActivity paused=false}
02-05 22:58:19.920: WARN/InputManagerService(58): Got RemoteException sending setActive(false) notification to pid 405 uid 10048
02-05 22:58:24.291: DEBUG/dalvikvm(216): GC_EXPLICIT freed 93 objects / 3736 bytes in 153ms
02-05 22:58:24.901: INFO/ActivityManager(58): Start proc com.bfarago.nevnap for service com.bfarago.nevnap/.UpdateService: pid=425 uid=10048 gids={1015}
02-05 22:58:28.966: WARN/ActivityManager(58): Activity destroy timeout for HistoryRecord{43e9a940 com.bfarago.nevnap/.MainActivity}
02-05 22:58:29.350: DEBUG/dalvikvm(263): GC_EXPLICIT freed 44 objects / 2032 bytes in 164ms
You want to use the method setLayoutParams of TextView and pass into it a new LinearLayout.LayoutParams(width, height) where width and height are integers that will specify the width and height. you can keep the height and set the width to whatever you want.
Related
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>
So, I have an app which uses the Viewpager and swiping. I got 3 fragments which contains a listview, and a custom adapter to set the rows.
In each fragment, I have a method to call the asynctask and fetch the JSON. I run this method in the onActivityCreated.
When I start the app, everything is working fine, the progressdialog shows, and all the list's are being set with the correct data.
The problem is that i want to be able to refresh all the lists when click the refresh-button in the actionbar (to check for new tweets).
The only way I've been able to use the refreshbutton is when I use the onOptionsItemSelected() in the MainActivity.
So I'm thinking, I can just call the methods who then again calls the asynctask.
case R.id.menu_refresh:
MSFTHost host = new MSFTHost();
host.getTweets();
...
But when I click the button, the whole thing force closes:
02-05 21:46:57.959: W/dalvikvm(15292): threadid=1: thread exiting with uncaught exception (group=0x40d5a930)02-05 21:46:58.045:
E/AndroidRuntime(15292): FATAL EXCEPTION: main
02-05 21:46:58.045: E/AndroidRuntime(15292): java.lang.NullPointerException
02-05 21:46:58.045: E/AndroidRuntime(15292): at com.sandan.HostingNorge.MSFTHost$DownloadWebPageTask.onPostExecute(MSFTHost.java:95)
02-05 21:46:58.045: E/AndroidRuntime(15292): at com.sandan.HostingNorge.MSFTHost$DownloadWebPageTask.onPostExecute(MSFTHost.java:1)
02-05 21:46:58.045: E/AndroidRuntime(15292): at android.os.AsyncTask.finish(AsyncTask.java:631)
02-05 21:46:58.045: E/AndroidRuntime(15292): at android.os.AsyncTask.access$600(AsyncTask.java:177)
02-05 21:46:58.045: E/AndroidRuntime(15292): at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:644)
02-05 21:46:58.045: E/AndroidRuntime(15292): at android.os.Handler.dispatchMessage(Handler.java:99)
02-05 21:46:58.045: E/AndroidRuntime(15292): at android.os.Looper.loop(Looper.java:137)
02-05 21:46:58.045: E/AndroidRuntime(15292): at android.app.ActivityThread.main(ActivityThread.java:5202)
02-05 21:46:58.045: E/AndroidRuntime(15292): at java.lang.reflect.Method.invokeNative(Native Method)
02-05 21:46:58.045: E/AndroidRuntime(15292): at java.lang.reflect.Method.invoke(Method.java:511)
02-05 21:46:58.045: E/AndroidRuntime(15292): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:799)
02-05 21:46:58.045: E/AndroidRuntime(15292): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:566)
02-05 21:46:58.045: E/AndroidRuntime(15292): at dalvik.system.NativeStart.main(Native Method)
the line 95 contains this:
listItems.add(new GetListItems(oneObject.getString("text"),oneObject.getString("created_at"),obj
.getString("profile_image_url"), obj
.getString("screen_name")));
I tried clearing listItems, but it didn't have any effect.
Any help please?
Edit:
If I was unclear, I want to get the JSON again and show in the list, just like on the first run.
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'm getting that exception when I pick a wallpaper. I'm actually not sure what function is the culprit. Here's the error log:
I/ActivityManager( 1360): Starting activity: Intent { cmp=com.android.wallpaper.livepicker/.LiveWallpaperPreview (has extras) }
W/dalvikvm(29175): threadid=1: thread exiting with uncaught exception (group=0x40020ac0)
E/AndroidRuntime(29175): FATAL EXCEPTION: main
E/AndroidRuntime(29175): java.lang.IllegalStateException: AssetManager has been finalized!
E/AndroidRuntime(29175): at android.content.res.AssetManager.isUpToDate(Native Method)
E/AndroidRuntime(29175): at android.app.ActivityThread.getPackageInfo(ActivityThread.java:2350)
E/AndroidRuntime(29175): at android.app.ActivityThread.getPackageInfoNoCheck(ActivityThread.java:2337)
E/AndroidRuntime(29175): at android.app.ActivityThread.handleCreateService(ActivityThread.java:2935)
E/AndroidRuntime(29175): at android.app.ActivityThread.access$3300(ActivityThread.java:125)
E/AndroidRuntime(29175): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2087)
E/AndroidRuntime(29175): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(29175): at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime(29175): at android.app.ActivityThread.main(ActivityThread.java:4627)
E/AndroidRuntime(29175): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(29175): at java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime(29175): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:878)
E/AndroidRuntime(29175): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:636)
E/AndroidRuntime(29175): at dalvik.system.NativeStart.main(Native Method)
I/ActivityManager( 1360): Displayed activity com.android.wallpaper.livepicker/.LiveWallpaperPreview: 331 ms (total 331 ms)
W/InputManagerService( 1360): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy#44bf5a08
I/ActivityManager( 1360): Process com.bukabros.videolivewallpaper (pid 29175) has died.
W/ActivityManager( 1360): Scheduling restart of crashed service com.bukabros.videolivewallpaper/.VideoLiveWallpaper in 5000ms
I/ActivityManager( 1360): Start proc com.bukabros.videolivewallpaper for service com.bukabros.videolivewallpaper/.VideoLiveWallpaper: pid=29207 uid=10090 gids={}
The only thing I can think of is that onCreate doesn't get called in the right order when the wallpaper gets picked cuz that's where I instantiate the asset manager.
And yes, I'm using the NDK but the asset manager doesn't get used there.
Ah nevermind. The culprit was that the handle to the assetmanager was a static variable. (That was just a quick hack for something else). Making that a normal variable solved the problem.
I am using Eclipse to write the program. I have gotten rid of the errors, and have completely compiled the code and when it launches in the emulator, it forces close. I have zipped the workspace so maybe someone can grab it and load it to see if they are able to see why its bombing out? deckertdesigns.com/Android/Todo_List.zip any help again, would be greatly appreciated. I feel once over this hump I will have some better knowledge in troubleshooting, just wish the debugger was catching this...
08-29 17:43:45.273: DEBUG/SntpClient(73): request time failed: java.net.SocketException:
Address family not supported by protocol
08-29 17:44:41.433: DEBUG/AndroidRuntime(357): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
08-29 17:44:41.433: DEBUG/AndroidRuntime(357): CheckJNI is ON
08-29 17:44:41.852: DEBUG/AndroidRuntime(357): --- registering native functions ---
08-29 17:44:43.293: DEBUG/AndroidRuntime(357): Shutting down VM
08-29 17:44:43.313: INFO/AndroidRuntime(357): NOTE: attach of thread 'Binder Thread #3' failed
08-29 17:44:43.323: DEBUG/dalvikvm(357): Debugger has detached; object registry had 1 entries
08-29 17:44:44.083: DEBUG/AndroidRuntime(365): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
08-29 17:44:44.083: DEBUG/AndroidRuntime(365): CheckJNI is ON
08-29 17:44:44.403: DEBUG/AndroidRuntime(365): --- registering native functions ---
08-29 17:44:45.573: INFO/ActivityManager(73): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.a8a.todolist/.ToDoList }
08-29 17:44:45.683: DEBUG/AndroidRuntime(365): Shutting down VM
08-29 17:44:45.713: DEBUG/dalvikvm(365): Debugger has detached; object registry had 1 entries
08-29 17:44:45.773: INFO/AndroidRuntime(365): NOTE: attach of thread 'Binder Thread #3' failed
08-29 17:44:45.843: INFO/ActivityManager(73): Start proc com.a8a.todolist for activity com.a8a.todolist/.ToDoList: pid=372 uid=10032 gids={1015}
08-29 17:44:47.013: DEBUG/AndroidRuntime(372): Shutting down VM
08-29 17:44:47.013: WARN/dalvikvm(372): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
08-29 17:44:47.043: ERROR/AndroidRuntime(372): FATAL EXCEPTION: main
08-29 17:44:47.043: ERROR/AndroidRuntime(372): android.app.SuperNotCalledException: Activity {com.a8a.todolist/com.a8a.todolist.ToDoList} did not call through to super.onCreate()
08-29 17:44:47.043: ERROR/AndroidRuntime(372): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2629)
08-29 17:44:47.043: ERROR/AndroidRuntime(372): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
08-29 17:44:47.043: ERROR/AndroidRuntime(372): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
08-29 17:44:47.043: ERROR/AndroidRuntime(372): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
08-29 17:44:47.043: ERROR/AndroidRuntime(372): at android.os.Handler.dispatchMessage(Handler.java:99)
08-29 17:44:47.043: ERROR/AndroidRuntime(372): at android.os.Looper.loop(Looper.java:123)
08-29 17:44:47.043: ERROR/AndroidRuntime(372): at android.app.ActivityThread.main(ActivityThread.java:4627)
08-29 17:44:47.043: ERROR/AndroidRuntime(372): at java.lang.reflect.Method.invokeNative(Native Method)
08-29 17:44:47.043: ERROR/AndroidRuntime(372): at java.lang.reflect.Method.invoke(Method.java:521)
08-29 17:44:47.043: ERROR/AndroidRuntime(372): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
08-29 17:44:47.043: ERROR/AndroidRuntime(372): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
08-29 17:44:47.043: ERROR/AndroidRuntime(372): at dalvik.system.NativeStart.main(Native Method)
08-29 17:44:47.063: WARN/ActivityManager(73): Force finishing activity com.a8a.todolist/.ToDoList
08-29 17:44:47.243: DEBUG/dalvikvm(73): GC_FOR_MALLOC freed 7176 objects / 434168 bytes in 169ms
08-29 17:44:47.633: WARN/ActivityManager(73): Activity pause timeout for HistoryRecord{43fc9668 com.a8a.todolist/.ToDoList}
08-29 17:44:53.253: INFO/Process(372): Sending signal. PID: 372 SIG: 9
08-29 17:44:53.285: INFO/ActivityManager(73): Process com.a8a.todolist (pid 372) has died.
08-29 17:44:53.323: WARN/InputManagerService(73): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy#440687c8
08-29 17:44:58.383: WARN/ActivityManager(73): Activity destroy timeout for HistoryRecord{43fc9668 com.a8a.todolist/.ToDoList}
Rohan is right, inside Eclipse you open the DDMS perspective, you'll see a tab called "Logcat" which contains all the printed logs and includes also a detailed stacktrace of the exception which caused the Force Close popup to appear.
You miss probably the the "super.onCreate(savedInstanceState)" in your onCreate method.
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(...);
...
}
Check out the logcat to see the error...it would be displayed against your package name in red color....This is the only method to check the Force Close type of errors....