0

I have an application and a corresponding widget for it. Whenever I kill my application by removing it from background processes and then I use my widget, a pop up telling it has crashed comes. Instead I want, if the app is killed, widget should run with the previous data it has. How should I handle this? Can't figure out..My logcat does not show anything about this crash. Please guide..

Atihska
  • 4,803
  • 10
  • 56
  • 98
  • Use LogCat to examine the Java stack trace associated with your crash. – CommonsWare Jul 15 '13 at 18:17
  • @CommonsWare When it crashes, my logcat does not show anything. – Atihska Jul 15 '13 at 18:23
  • Then how have you determined that it "crashed"? – CommonsWare Jul 15 '13 at 18:27
  • @CommonsWare On my phone, a dialog box pops.. – Atihska Jul 15 '13 at 20:00
  • @CommonsWare Now I am getting messages. I just restarted eclipse and its getting now. So it is a null pointer exception. Once the app is killed, all the buttons/clicks in widget gives me null pointer exception.. – Atihska Jul 15 '13 at 20:03
  • Then you need to use the stack trace, find the lines in your source code that are raising the exception, and determine what is `null`. Then, you can determine what assumptions you are making. For example, perhaps you are assuming that static data members live forever (hint: they do not). – CommonsWare Jul 15 '13 at 20:11
  • @CommonsWare It says unable to start receiver (my broadcast receiver). How should I handle it. I have put my parts in try catch but still its not handled. Also, if static members does not live forever, then what should I declare vars as all my vars are static. external scope instead of static?? – Atihska Jul 15 '13 at 21:16
  • This is what happens if you kill an app out from behind an appwidget. The widget won't run "with the data it has" because you've killed it. – Simes Sep 10 '13 at 15:25

0 Answers0