Hi Kevin,

Thanks a lot for giving it a try.  I saw this stack trace yesterday in the
market console, but I am having difficulty reproducing it.  Can you tell me
the steps you went through for this to happen?  Or does it happen all the
time?  Are the widgets removed from the list of widgets?

I am using getResources().getIdentifier() to get the resouce id of a text
field.  I think I must be supplying the wrong package name perhaps.  This
code is within a library that both Awesome Widgets and Awesome Widgets Lite
use.  I have been getting the name of the app's package and using that in
the getIdentifier call, e.g.: -

int dayResource = getResources().getIdentifier("dayField" + i, "id",
mainAppPackage);

I'm thinking that this might be a mistake as it's not finding the field
when I call

((TextView) layout.findViewById(dayResource)).setTextColor(colour);

This should always be found, hence the lack of null checking, but obviously
the dayResouce id must be invalid.

I'll change mainAppPackage to this.getPackageName(), hopefully that should
work.

Thanks again,
Ash



2012/1/6 Kevin TeslaCoil Software <ke...@teslacoilsw.com>

> I've actually been hacking at the ICS Launcher2 code so I figured I'd
> give the widget a try. In my case (GSM Galaxy Nexus, 4.0.2) I keep
> getting a NullPointerException in your
> AwesomeClockActivity.setTextColour (trace below). Happens with stock
> 4.0.2 launcher as well as Nova Launcher (my app, based on ICS
> Launcher2 from 4.0.3). At least this crash is your own app so it
> should be easier to debug :).
>
> If I keep trying to add over and over again it keeps FCs, but
> sometimes I don't see I only see the FC from logcat (no dialog) and
> see "W/ActivityManager(  193): Process sirocco.widgetslite has crashed
> too many times: killing!".
>
>
> Trace:
> E/AndroidRuntime(20564): java.lang.RuntimeException: Unable to start
> activity ComponentInfo{sirocco.widgetslite/
> sirocco.widgets.AwesomeClockActivity}: java.lang.NullPointerException
> ...
> E/AndroidRuntime(20564): Caused by: java.lang.NullPointerException
> E/AndroidRuntime(20564):        at
>
> sirocco.widgets.AwesomeClockActivity.setTextColour(AwesomeClockActivity.java:
> 572)
> E/AndroidRuntime(20564):        at
> sirocco.widgets.AwesomeClockActivity.onCreate(AwesomeClockActivity.java:
> 301)
>
>
>
> --
Awesome Widgets <http://www.siroccosoftware.com/awesome>
Online Racing Championship <http://onlineracingchampionship.com>
Twitter <http://twitter.com/AshMcConnell>

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

Reply via email to