Hi all,

I have created & installed a simple widget into the Android 2.2
simulator.

Now when I bootup, I do see onEnabled() called once.

But then the package manager decides to force stop the package and
reinstall it.

However from now on, onEnabled() is never called - only onUpdate().

I have included the full logs below.

I am initializing a SQLite database in onEnabled() and according to
the
developer documentation, that is where we are supposed to do it. So I
am
left in a situation where onUpdate() in my widget is called but the
database
has not been initialized. I don't want to hack onUpdate() - I'd rather
understand
what I'm doing wrong.

thanks
shaun

Logs follow:



01-31 14:54:11.474: I/ActivityManager(58): Start proc
org.example.widget for broadcast org.example.widget/.Widget: pid=251
uid=10049 gids={}
01-31 14:54:12.034: D/WIDGET(251): onEnabled
01-31 14:54:12.103: D/WIDGET(251): onUpdate
01-31 14:54:12.276: D/WIDGET(251): onUpdate

[.......]

01-31 14:54:14.024: I/PackageManager(58): Removing non-system
package:org.example.widget
01-31 14:54:14.024: I/ActivityManager(58): Force stopping package
org.example.widget uid=10049
01-31 14:54:14.033: I/Process(58): Sending signal. PID: 251 SIG: 9

[.......]

01-31 14:54:14.993: D/PackageManager(58): Scanning package
org.example.widget
01-31 14:54:15.036: I/PackageManager(58): Package org.example.widget
codePath changed from /data/app/org.example.widget-1.apk to /data/app/
org.example.widget-2.apk; Retaining data and using new
01-31 14:54:15.054: I/PackageManager(58): /data/app/
org.example.widget-2.apk changed; unpacking
01-31 14:54:15.164: D/installd(34): DexInv: --- BEGIN '/data/app/
org.example.widget-2.apk' ---
01-31 14:54:16.403: D/dalvikvm(258): DexOpt: load 40ms, verify 47ms,
opt 3ms
01-31 14:54:16.424: D/installd(34): DexInv: --- END '/data/app/
org.example.widget-2.apk' (success) ---
01-31 14:54:16.474: I/Launcher.Model(127): not binding apps: no
Launcher activity
01-31 14:54:16.507: I/ActivityManager(58): Force stopping package
org.example.widget uid=10049
01-31 14:54:16.514: W/PackageManager(58): Code path for pkg :
org.example.widget changing from /data/app/org.example.widget-1.apk
to /data/app/org.example.widget-2.apk
01-31 14:54:16.523: W/PackageManager(58): Resource path for pkg :
org.example.widget changing from /data/app/org.example.widget-1.apk
to /data/app/org.example.widget-2.apk
01-31 14:54:16.523: D/PackageManager(58):   Receivers:
org.example.widget.Widget

[...........]

01-31 14:54:17.374: D/PackageManager(58): New package installed in /
data/app/org.example.widget-2.apk
01-31 14:54:18.264: I/ActivityManager(58): Force stopping package
org.example.widget uid=10049

[............]

01-31 14:54:20.454: I/ActivityManager(58): Start proc
org.example.widget for broadcast org.example.widget/.Widget: pid=266
uid=10049 gids={}
01-31 14:54:21.214: D/WIDGET(266): onUpdate

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to