0

I am developing inteligent study application and I have any problem with restoring my Activity. Activity takes some data from database for the list and there are any other Views. Now my problem - if I close (hide) this application in this situation (with Home button), run any other application (for example sending sms) and then when I go back to my running application there is big error. I don't know where is the problem (debug not help). Please help.

Here is the error from Log:

11-04 16:03:58.270: ERROR/kernel(130): [115047.678649] init: untracked pid 1183 exited
11-04 16:04:12.660: ERROR/jdwp(1276): Failed sending reply to debugger: Broken pipe
11-04 16:04:12.961: ERROR/AndroidRuntime(1276): FATAL EXCEPTION: main
11-04 16:04:12.961: ERROR/AndroidRuntime(1276): java.lang.NullPointerException
11-04 16:04:12.961: ERROR/AndroidRuntime(1276):     at cz.android.zkouseni.VyberLekce$AdapterVyberLekce.getView(VyberLekce.java:262)
11-04 16:04:12.961: ERROR/AndroidRuntime(1276):     at android.widget.AbsListView.obtainView(AbsListView.java:1519)
11-04 16:04:12.961: ERROR/AndroidRuntime(1276):     at android.widget.ListView.makeAndAddView(ListView.java:1749)
11-04 16:04:12.961: ERROR/AndroidRuntime(1276):     at android.widget.ListView.fillDown(ListView.java:674)
11-04 16:04:12.961: ERROR/AndroidRuntime(1276):     at android.widget.ListView.fillFromTop(ListView.java:731)
11-04 16:04:12.961: ERROR/AndroidRuntime(1276):     at android.widget.ListView.layoutChildren(ListView.java:1602)
11-04 16:04:12.961: ERROR/AndroidRuntime(1276):     at android.widget.AbsListView.onLayout(AbsListView.java:1349)
11-04 16:04:12.961: ERROR/AndroidRuntime(1276):     at android.view.View.layout(View.java:7320)
11-04 16:04:12.961: ERROR/AndroidRuntime(1276):     at android.widget.RelativeLayout.onLayout(RelativeLayout.java:912)
11-04 16:04:12.961: ERROR/AndroidRuntime(1276):     at android.view.View.layout(View.java:7320)
11-04 16:04:12.961: ERROR/AndroidRuntime(1276):     at android.widget.FrameLayout.onLayout(FrameLayout.java:342)
11-04 16:04:12.961: ERROR/AndroidRuntime(1276):     at android.view.View.layout(View.java:7320)
11-04 16:04:12.961: ERROR/AndroidRuntime(1276):     at android.widget.FrameLayout.onLayout(FrameLayout.java:342)
11-04 16:04:12.961: ERROR/AndroidRuntime(1276):     at android.view.View.layout(View.java:7320)
11-04 16:04:12.961: ERROR/AndroidRuntime(1276):     at android.view.ViewRoot.performTraversals(ViewRoot.java:1162)
11-04 16:04:12.961: ERROR/AndroidRuntime(1276):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1882)
11-04 16:04:12.961: ERROR/AndroidRuntime(1276):     at android.os.Handler.dispatchMessage(Handler.java:99)
11-04 16:04:12.961: ERROR/AndroidRuntime(1276):     at android.os.Looper.loop(Looper.java:130)
11-04 16:04:12.961: ERROR/AndroidRuntime(1276):     at android.app.ActivityThread.main(ActivityThread.java:3701)
11-04 16:04:12.961: ERROR/AndroidRuntime(1276):     at java.lang.reflect.Method.invokeNative(Native Method)
11-04 16:04:12.961: ERROR/AndroidRuntime(1276):     at java.lang.reflect.Method.invoke(Method.java:507)
11-04 16:04:12.961: ERROR/AndroidRuntime(1276):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
11-04 16:04:12.961: ERROR/AndroidRuntime(1276):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:624)
11-04 16:04:12.961: ERROR/AndroidRuntime(1276):     at dalvik.system.NativeStart.main(Native Method)
11-04 16:06:51.880: ERROR/ServiceLocator(1412): ServiceLocator$VoipServiceConnection.onServiceConnected ext: android.os.BinderProxy@2b01c718
11-04 16:08:10.580: ERROR/ActivityThread(1506): Failed to find provider info for com.maxmpz.audioplayer
FoamyGuy
  • 46,603
  • 18
  • 125
  • 156
AdaMoOo
  • 427
  • 2
  • 5
  • 12

2 Answers2

0

You are getting a NullPointer at line 262 inisde the getView method of your adapter. Which means either a view that you are trying to put data into is null, or one of the data points that you are using is coming back null from your db for some reason.

Post the code for your adapter and include a comment that ponits out which line is 262 and it will be easier to give you more specific help.

FoamyGuy
  • 46,603
  • 18
  • 125
  • 156
0

you are getting a NullPointerException in VyberLekce.java line 262, which maybe caused because you are not saving application state, and when app resumes it doesn't find some variable

if that's the case this Saving Android Activity state using Save Instance State might be helpful

Community
  • 1
  • 1
Optimus
  • 2,716
  • 4
  • 29
  • 49