Access a database from Broadcast receiver? - android

I cant access my SQlite database from my broadcast receiver. Is it even possible? I keep getting a NullPointerException. In the onReceive of the BroadcastReceiver I call
mDbHelper = new ResponderDbAdapter(context);
mDbHelper.open();
Is it something to do with the context? I want to pull database info that gets set in my MainActivity into the BroadCast Receiver.
Ideas?
EDIT :
ERROR:
07-29 16:43:46.491: ERROR/AndroidRuntime(6772): FATAL EXCEPTION: main
07-29 16:43:46.491: ERROR/AndroidRuntime(6772): java.lang.RuntimeException: Unable to start receiver com.test.example.feed.receiver.RecieveSMS: java.lang.NullPointerException
07-29 16:43:46.491: ERROR/AndroidRuntime(6772): at android.app.ActivityThread.handleReceiver(ActivityThread.java:1805)
07-29 16:43:46.491: ERROR/AndroidRuntime(6772): at android.app.ActivityThread.access$2400(ActivityThread.java:117)
07-29 16:43:46.491: ERROR/AndroidRuntime(6772): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:981)
07-29 16:43:46.491: ERROR/AndroidRuntime(6772): at android.os.Handler.dispatchMessage(Handler.java:99)
07-29 16:43:46.491: ERROR/AndroidRuntime(6772): at android.os.Looper.loop(Looper.java:130)
07-29 16:43:46.491: ERROR/AndroidRuntime(6772): at android.app.ActivityThread.main(ActivityThread.java:3684)
07-29 16:43:46.491: ERROR/AndroidRuntime(6772): at java.lang.reflect.Method.invokeNative(Native Method)
07-29 16:43:46.491: ERROR/AndroidRuntime(6772): at java.lang.reflect.Method.invoke(Method.java:507)
07-29 16:43:46.491: ERROR/AndroidRuntime(6772): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:845)
07-29 16:43:46.491: ERROR/AndroidRuntime(6772): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:603)
07-29 16:43:46.491: ERROR/AndroidRuntime(6772): at dalvik.system.NativeStart.main(Native Method)
07-29 16:43:46.491: ERROR/AndroidRuntime(6772): Caused by: java.lang.NullPointerException
07-29 16:43:46.491: ERROR/AndroidRuntime(6772): at com.test.example.feed.receiver.RecieveSMS.onReceive(RecieveSMS.java:67)
07-29 16:43:46.491: ERROR/AndroidRuntime(6772): at android.app.ActivityThread.handleReceiver(ActivityThread.java:1794)
07-29 16:43:46.491: ERROR/AndroidRuntime(6772): ... 10 more
EDIT: A Better Explanation
I have a separate activity that allows the user to add items to the database. I want to share this with the receiver so that the broadcast receiver knows what items are in the database. ResponderDbAdapter is a class that accesses the Db and performs fetches and inserts to the DB. What would the context be...if I have the broadcast receiver running even if the application is closed how can it access a database?

The Broadcast Receivers version of the context is probably not working for the DBHelper. Have the Receiver fire up a service and have the service access the DB

Related

Swipe to the right then the left gives error ANDROID

I am creating an application in Android in Eclipse with 3 screen with Swipe horizontally, the last tab got a Map Fragment, but when swipe right the first time is it normal when take a swipe to the left and back to make a right the application crashes and makes me this error, what could it be?
Thanks in advance
07-29 23:35:38.279: E/AndroidRuntime(10353): FATAL EXCEPTION: main
07-29 23:35:38.279: E/AndroidRuntime(10353): Process: com.sapires.JoesPizzariaGEN, PID: 10353
07-29 23:35:38.279: E/AndroidRuntime(10353): android.view.InflateException: Binary XML file line #8: Error inflating class fragment
07-29 23:35:38.279: E/AndroidRuntime(10353): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:719)
07-29 23:35:38.279: E/AndroidRuntime(10353): at android.view.LayoutInflater.rInflate(LayoutInflater.java:761)
07-29 23:35:38.279: E/AndroidRuntime(10353): at android.view.LayoutInflater.inflate(LayoutInflater.java:498)
07-29 23:35:38.279: E/AndroidRuntime(10353): at android.view.LayoutInflater.inflate(LayoutInflater.java:398)
07-29 23:35:38.279: E/AndroidRuntime(10353): at com.sapires.JoesPizzaria.Mapa.onCreateView(Mapa.java:16)
07-29 23:35:38.279: E/AndroidRuntime(10353): at android.support.v4.app.Fragment.performCreateView(Fragment.java:1504)
07-29 23:35:38.279: E/AndroidRuntime(10353): at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:942)
07-29 23:35:38.279: E/AndroidRuntime(10353): at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1121)
07-29 23:35:38.279: E/AndroidRuntime(10353): at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:682)
07-29 23:35:38.279: E/AndroidRuntime(10353): at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1484)
07-29 23:35:38.279: E/AndroidRuntime(10353): at android.support.v4.app.FragmentManagerImpl.executePendingTransactions(FragmentManager.java:482)
07-29 23:35:38.279: E/AndroidRuntime(10353): at android.support.v4.app.FragmentStatePagerAdapter.finishUpdate(FragmentStatePagerAdapter.java:163)
07-29 23:35:38.279: E/AndroidRuntime(10353): at android.support.v4.view.ViewPager.populate(ViewPager.java:1073)
07-29 23:35:38.279: E/AndroidRuntime(10353): at android.support.v4.view.ViewPager.populate(ViewPager.java:919)
07-29 23:35:38.279: E/AndroidRuntime(10353): at android.support.v4.view.ViewPager$3.run(ViewPager.java:249)
07-29 23:35:38.279: E/AndroidRuntime(10353): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:803)
07-29 23:35:38.279: E/AndroidRuntime(10353): at android.view.Choreographer.doCallbacks(Choreographer.java:603)
07-29 23:35:38.279: E/AndroidRuntime(10353): at android.view.Choreographer.doFrame(Choreographer.java:572)
07-29 23:35:38.279: E/AndroidRuntime(10353): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:789)
07-29 23:35:38.279: E/AndroidRuntime(10353): at android.os.Handler.handleCallback(Handler.java:733)
07-29 23:35:38.279: E/AndroidRuntime(10353): at android.os.Handler.dispatchMessage(Handler.java:95)
07-29 23:35:38.279: E/AndroidRuntime(10353): at android.os.Looper.loop(Looper.java:136)
07-29 23:35:38.279: E/AndroidRuntime(10353): at android.app.ActivityThread.main(ActivityThread.java:5579)
07-29 23:35:38.279: E/AndroidRuntime(10353): at java.lang.reflect.Method.invoke(Native Method)
07-29 23:35:38.279: E/AndroidRuntime(10353): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1268)
07-29 23:35:38.279: E/AndroidRuntime(10353): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1084)
07-29 23:35:38.279: E/AndroidRuntime(10353): Caused by: java.lang.IllegalArgumentException: Binary XML file line #8: Duplicate id 0x7f070016, tag null, or parent id 0xffffffff with another fragment for com.google.android.gms.maps.MapFragment
07-29 23:35:38.279: E/AndroidRuntime(10353): at android.app.Activity.onCreateView(Activity.java:5002)
07-29 23:35:38.279: E/AndroidRuntime(10353): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:695)
07-29 23:35:38.279: E/AndroidRuntime(10353): ... 25 more
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical" >
<fragment
android:id="#+id/fragment"
android:name="com.google.android.gms.maps.MapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
class="com.google.android.gms.maps.MapFragment" />
</RelativeLayout>
Well, is seems to be caused by a problem in a xml file, but with the stack trace alone I'm afraid i can't help you.
However, check your layout file for that fragment, it may just be a duplicate id.

Android crash: Failed to initialize display event receiver

my application crashed when I start it again after closing it for quite some time. Below you can see the log that shows the error:
java.lang.RuntimeException: Failed to initialize display event receiver. status=-2147483648
at android.view.DisplayEventReceiver.nativeInit(Native Method)
at android.view.DisplayEventReceiver.<init>(DisplayEventReceiver.java:61)
at android.view.Choreographer$FrameDisplayEventReceiver.<init>(Choreographer.java:725)
at android.view.Choreographer.<init>(Choreographer.java:169)
at android.view.Choreographer.<init>(Choreographer.java:69)
at android.view.Choreographer$1.initialValue(Choreographer.java:95)
at android.view.Choreographer$1.initialValue(Choreographer.java:88)
at java.lang.ThreadLocal$Values.getAfterMiss(ThreadLocal.java:430)
at java.lang.ThreadLocal.get(ThreadLocal.java:65)
at android.view.Choreographer.getInstance(Choreographer.java:194)
at android.view.ViewRootImpl.<init>(ViewRootImpl.java:487)
at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:235)
at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2892)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2304)
at android.app.ActivityThread.access$700(ActivityThread.java:154)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1284)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5306)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
at dalvik.system.NativeStart.main(Native Method)
I'm looking for the solution or at least someone with similar problem but surprisingly there is none.
Someone can help me?
Thank you!

Error coming while running android application

I have created an android application using eclipse but application is not running on AVD it is saying "Unfortunately has stopped working"
Log cat message is given below -
07-29 04:59:50.789: W/dalvikvm(784): threadid=1: thread exiting with uncaught exception (group=0x414c4700)
07-29 04:59:50.808: E/AndroidRuntime(784): FATAL EXCEPTION: main
07-29 04:59:50.808: E/AndroidRuntime(784): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.androidlove/com.example.androidlove.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "com.example.androidlove.MainActivity" on path: DexPathList[[zip file "/data/app/com.example.androidlove-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.example.androidlove-1, /system/lib]]
07-29 04:59:50.808: E/AndroidRuntime(784): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2137)
07-29 04:59:50.808: E/AndroidRuntime(784): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
07-29 04:59:50.808: E/AndroidRuntime(784): at android.app.ActivityThread.access$600(ActivityThread.java:141)
07-29 04:59:50.808: E/AndroidRuntime(784): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
07-29 04:59:50.808: E/AndroidRuntime(784): at android.os.Handler.dispatchMessage(Handler.java:99)
07-29 04:59:50.808: E/AndroidRuntime(784): at android.os.Looper.loop(Looper.java:137)
07-29 04:59:50.808: E/AndroidRuntime(784): at android.app.ActivityThread.main(ActivityThread.java:5103)
07-29 04:59:50.808: E/AndroidRuntime(784): at java.lang.reflect.Method.invokeNative(Native Method)
07-29 04:59:50.808: E/AndroidRuntime(784): at java.lang.reflect.Method.invoke(Method.java:525)
07-29 04:59:50.808: E/AndroidRuntime(784): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
07-29 04:59:50.808: E/AndroidRuntime(784): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
07-29 04:59:50.808: E/AndroidRuntime(784): at dalvik.system.NativeStart.main(Native Method)
07-29 04:59:50.808: E/AndroidRuntime(784): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.example.androidlove.MainActivity" on path: DexPathList[[zip file "/data/app/com.example.androidlove-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.example.androidlove-1, /system/lib]]
07-29 04:59:50.808: E/AndroidRuntime(784): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:53)
07-29 04:59:50.808: E/AndroidRuntime(784): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
07-29 04:59:50.808: E/AndroidRuntime(784): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
07-29 04:59:50.808: E/AndroidRuntime(784): at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
07-29 04:59:50.808: E/AndroidRuntime(784): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2128)
07-29 04:59:50.808: E/AndroidRuntime(784): ... 11 more
07-29 04:59:58.399: I/Process(784): Sending signal. PID: 784 SIG: 9
Please help me i am tired of solving this error.....
I faced the same problem and I found the sample code was put in the "JAVA" folder instead of the "src" folder. After moving the code to src, the problem was solved.
I hope that works.
add the mainActivity in menifest according your package name if package is: com.example.androidlove-1
<activity
android:name="com.example.androidlove-1.MainActivity" >
</activity>
You did not declare MainActivity class in the manifest.xml.
<activity
android:name=".MainActivity" >
</activity>

error inflating class

I am fairly new to all this, so please bear with me! I have been trying to work out the style of my app today, and cant quite get it. I keep getting this error inflating class when I try to run the app on my AVD. I have no clue what it means, or how to fix it. I can tell its talking about my MainActivity, so Ill post the information for that as well.
07-29 21:41:35.751: D/dalvikvm(431): GC_EXTERNAL_ALLOC freed 53K, 53% free 2546K/5379K, external 1625K/2137K, paused 104ms
07-29 21:41:35.811: E/dalvikvm-heap(431): 31740000-byte external allocation too large for this process.
07-29 21:41:35.911: E/GraphicsJNI(431): VM won't let us allocate 31740000 bytes
07-29 21:41:35.911: D/dalvikvm(431): GC_FOR_MALLOC freed <1K, 53% free 2546K/5379K, external 1625K/2137K, paused 91ms
07-29 21:41:35.911: D/skia(431): --- decoder->decode returned false
07-29 21:41:35.971: D/AndroidRuntime(431): Shutting down VM
07-29 21:41:35.971: W/dalvikvm(431): threadid=1: thread exiting with uncaught exception (group=0x40015560)
07-29 21:41:36.021: E/AndroidRuntime(431): FATAL EXCEPTION: main
07-29 21:41:36.021: E/AndroidRuntime(431): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.madonk.louisiana.festivals/com.madonk.louisiana.festivals.MainActivity}: android.view.InflateException: Binary XML file line #1: Error inflating class android.widget.RelativeLayout
07-29 21:41:36.021: E/AndroidRuntime(431): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647)
07-29 21:41:36.021: E/AndroidRuntime(431): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
07-29 21:41:36.021: E/AndroidRuntime(431): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
07-29 21:41:36.021: E/AndroidRuntime(431): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
07-29 21:41:36.021: E/AndroidRuntime(431): at android.os.Handler.dispatchMessage(Handler.java:99)
07-29 21:41:36.021: E/AndroidRuntime(431): at android.os.Looper.loop(Looper.java:123)
07-29 21:41:36.021: E/AndroidRuntime(431): at android.app.ActivityThread.main(ActivityThread.java:3683)
07-29 21:41:36.021: E/AndroidRuntime(431): at java.lang.reflect.Method.invokeNative(Native Method)
07-29 21:41:36.021: E/AndroidRuntime(431): at java.lang.reflect.Method.invoke(Method.java:507)
07-29 21:41:36.021: E/AndroidRuntime(431): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
07-29 21:41:36.021: E/AndroidRuntime(431): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
07-29 21:41:36.021: E/AndroidRuntime(431): at dalvik.system.NativeStart.main(Native Method)
07-29 21:41:36.021: E/AndroidRuntime(431): Caused by: android.view.InflateException: Binary XML file line #1: Error inflating class android.widget.RelativeLayout
07-29 21:41:36.021: E/AndroidRuntime(431): at android.view.LayoutInflater.createView(LayoutInflater.java:518)
07-29 21:41:36.021: E/AndroidRuntime(431): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
07-29 21:41:36.021: E/AndroidRuntime(431): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:568)
07-29 21:41:36.021: E/AndroidRuntime(431): at android.view.LayoutInflater.inflate(LayoutInflater.java:386)
07-29 21:41:36.021: E/AndroidRuntime(431): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
07-29 21:41:36.021: E/AndroidRuntime(431): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
07-29 21:41:36.021: E/AndroidRuntime(431): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:207)
07-29 21:41:36.021: E/AndroidRuntime(431): at android.app.Activity.setContentView(Activity.java:1657)
07-29 21:41:36.021: E/AndroidRuntime(431): at com.madonk.louisiana.festivals.MainActivity.onCreate(MainActivity.java:16)
07-29 21:41:36.021: E/AndroidRuntime(431): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
07-29 21:41:36.021: E/AndroidRuntime(431): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
07-29 21:41:36.021: E/AndroidRuntime(431): ... 11 more
07-29 21:41:36.021: E/AndroidRuntime(431): Caused by: java.lang.reflect.InvocationTargetException
07-29 21:41:36.021: E/AndroidRuntime(431): at java.lang.reflect.Constructor.constructNative(Native Method)
07-29 21:41:36.021: E/AndroidRuntime(431): at java.lang.reflect.Constructor.newInstance(Constructor.java:415)
07-29 21:41:36.021: E/AndroidRuntime(431): at android.view.LayoutInflater.createView(LayoutInflater.java:505)
07-29 21:41:36.021: E/AndroidRuntime(431): ... 21 more
07-29 21:41:36.021: E/AndroidRuntime(431): Caused by: java.lang.OutOfMemoryError: bitmap size exceeds VM budget
07-29 21:41:36.021: E/AndroidRuntime(431): at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
07-29 21:41:36.021: E/AndroidRuntime(431): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:460)
07-29 21:41:36.021: E/AndroidRuntime(431): at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:336)
07-29 21:41:36.021: E/AndroidRuntime(431): at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:697)
07-29 21:41:36.021: E/AndroidRuntime(431): at android.content.res.Resources.loadDrawable(Resources.java:1709)
07-29 21:41:36.021: E/AndroidRuntime(431): at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
07-29 21:41:36.021: E/AndroidRuntime(431): at android.view.View.<init>(View.java:1951)
07-29 21:41:36.021: E/AndroidRuntime(431): at android.view.View.<init>(View.java:1899)
07-29 21:41:36.021: E/AndroidRuntime(431): at android.view.ViewGroup.<init>(ViewGroup.java:286)
07-29 21:41:36.021: E/AndroidRuntime(431): at android.widget.RelativeLayout.<init>(RelativeLayout.java:173)
07-29 21:41:36.021: E/AndroidRuntime(431): ... 24 more
07-29 21:42:43.762: I/Process(431): Sending signal. PID: 431 SIG: 9
Main_Activity.xml
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#drawable/background" >
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginBottom="39dp"
android:text="#string/Definitive"
android:textColor="#style/AppTheme"
android:textSize="20dp"
android:textStyle="bold"
tools:context=".MainActivity" />
<Button
android:id="#+id/button_southwest"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="136dp"
android:onClick="showOther"
android:text="#string/Southwest" />
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/textView1"
android:layout_centerHorizontal="true"
android:text="#string/Select_a_region"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#style/AppTheme"
android:textSize="20dp" />
</RelativeLayout>
Looks like your background drawable is too big, try to run app without background for RelativeLayout. Consider using color instead of drawable for your background.
You cannot use uppercase letters when naming resources in Android. Here you have #string/Definitive and #string/Select_a_region. Rename those and you should be fine. Hope this helps.

assetmanager has been finalized?

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.

Categories

Resources