Android expanablelistview med en sqlite database, null pointer exception e...

Tags:    java android

Hej mennesker jeg er pt i gang med at lave en app til et skole projekt i android, hvor jeg forsøger at forbinde et expanablelist view til en sqldatabase uden held.

For at gøre det kort har jeg allerede linket til stackoverflow hvor jeg også har stilt spørgsmålet.

Vil være fedt hvis i kan hjælpe mig videre :-)

her er linket

http://stackoverflow.com/questions/33400453/sqlite-null-object-on-getwritabledatabase



2 svar postet i denne tråd vises herunder
0 indlæg har modtaget i alt 0 karma
Sorter efter stemmer Sorter efter dato
Hvis du vil have det løst, hjælper det hvis du viser os koden.



Ja jeg vil gerne have det løst er kommet lidt længere med min kode, så paster lige det jeg har fået lavet. Forhånd tak for jeres hjælp :0)

here goes:

Items.java

Fold kodeboks ind/udJava kode 


Connection.java

Fold kodeboks ind/udJava kode 


Error full stack

10-29 23:40:23.138 951-951/? D/libEGL: loaded /system/lib/egl/libGLESv2_emulation.so
10-29 23:40:23.141 951-951/? D/: HostConnection::get() New Host Connection established 0xb70921c0, tid 951
10-29 23:40:23.835 1025-1030/? D/libEGL: loaded /system/lib/egl/libGLESv2_emulation.so
10-29 23:40:23.844 1025-1030/? D/: HostConnection::get() New Host Connection established 0xb655c2b0, tid 1030
10-29 23:40:23.850 951-979/? D/: HostConnection::get() New Host Connection established 0xb7092580, tid 979
10-29 23:40:24.117 951-982/? D/: HostConnection::get() New Host Connection established 0xb7092c20, tid 982
10-29 23:40:31.331 1293-1293/? I/InstallerConnection: connecting...
10-29 23:40:31.344 1293-1293/? I/InstallerConnection: disconnecting...
10-29 23:40:31.457 1293-1293/? I/InstallerConnection: connecting...
10-29 23:40:39.639 1293-1293/? I/SystemServer: BackgroundDexOptService
10-29 23:40:39.641 1293-1363/? D/: HostConnection::get() New Host Connection established 0xa0886540, tid 1363
10-29 23:40:39.818 1293-1314/? W/KeyguardServiceDelegate: onScreenTurningOn(): no keyguard service!
10-29 23:40:39.819 951-1334/? D/: HostConnection::get() New Host Connection established 0xb708b090, tid 1334
10-29 23:40:39.826 1293-1293/? W/MountService: Failed to remount UID 10001 as none: com.android.server.NativeDaemonConnector$NativeDaemonFailureException: command '17 volume remount_uid 10001 none' failed with '400 17 Command failed'
10-29 23:40:39.837 1293-1312/? D/: HostConnection::get() New Host Connection established 0x9fabf210, tid 1312
10-29 23:40:40.092 1293-1329/? I/ActivityManager: Launching preboot mode app: ProcessRecord{37ac7e4 1391:android.process.acore/u0a2}
10-29 23:40:40.101 1293-1293/? D/: HostConnection::get() New Host Connection established 0x9fabf550, tid 1293
10-29 23:40:44.430 1488-1879/? D/OpenGLRenderer: ambientRatio = 1.50
10-29 23:40:44.433 1488-1488/? D/: HostConnection::get() New Host Connection established 0xab78aea0, tid 1488
10-29 23:40:44.501 1488-1488/? D/ViewRootImpl: changeCanvasOpacity: opaque=true
10-29 23:40:44.539 1488-1879/? D/: HostConnection::get() New Host Connection established 0xac03df30, tid 1879
10-29 23:40:48.641 1721-1721/? I/Telephony: AccountEntry: Registered phoneAccount: [[ ] PhoneAccount: ComponentInfo{com.android.phone/com.android.services.telephony.TelephonyConnectionService}, [e0184adedf913b076626646d3f52c3b49c39ad6d], UserHandle{0} Capabilities: 54 Schemes: tel voicemail ] with handle: ComponentInfo{com.android.phone/com.android.services.telephony.TelephonyConnectionService}, [e0184adedf913b076626646d3f52c3b49c39ad6d], UserHandle{0}
10-29 23:40:49.319 1293-1470/? I/Telecom: PhoneAccountRegistrar: New phone account registered: [[ ] PhoneAccount: ComponentInfo{com.android.phone/com.android.services.telephony.TelephonyConnectionService}, [e2f7d48dd2b5ca523e7313cf4ba0f6ea830b6281], UserHandle{0} Capabilities: 54 Schemes: tel voicemail ]
10-29 23:40:49.334 1721-1721/? I/Telephony: AccountEntry: Registered phoneAccount: [[ ] PhoneAccount: ComponentInfo{com.android.phone/com.android.services.telephony.TelephonyConnectionService}, [e2f7d48dd2b5ca523e7313cf4ba0f6ea830b6281], UserHandle{0} Capabilities: 54 Schemes: tel voicemail ] with handle: ComponentInfo{com.android.phone/com.android.services.telephony.TelephonyConnectionService}, [e2f7d48dd2b5ca523e7313cf4ba0f6ea830b6281], UserHandle{0}
10-29 23:40:49.337 1721-1721/? I/Telephony: TelecomAccountRegistry: Unregistering phone account ComponentInfo{com.android.phone/com.android.services.telephony.TelephonyConnectionService}, [e0184adedf913b076626646d3f52c3b49c39ad6d], UserHandle{0}.
10-29 23:40:51.091 1752-1752/? E/GmsWearableLS: GoogleApiClient connection failed: ConnectionResult{statusCode=API_UNAVAILABLE, resolution=null, message=null}
10-29 23:40:53.283 1752-1752/? E/GmsWearableLS: GoogleApiClient connection failed: ConnectionResult{statusCode=API_UNAVAILABLE, resolution=null, message=null}
10-29 23:40:53.308 1752-2177/? E/MDM: [106] b.run: Couldn't connect to Google API client: ConnectionResult{statusCode=API_UNAVAILABLE, resolution=null, message=null}
10-29 23:40:57.362 2281-2340/? D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
10-29 23:40:57.364 2281-2281/? D/: HostConnection::get() New Host Connection established 0xab78ae20, tid 2281
10-29 23:40:57.392 1488-1488/? D/PhoneStatusBar: disable: < expand* icons alerts system_info back* home* recent* clock search* quick_settings >
10-29 23:40:57.423 2281-2340/? D/: HostConnection::get() New Host Connection established 0xaef3cf30, tid 2340
10-29 23:40:59.606 1752-2357/? E/MDM: [108] b.run: Couldn't connect to Google API client: ConnectionResult{statusCode=API_UNAVAILABLE, resolution=null, message=null}
10-29 23:41:00.390 1752-2177/? E/MDM: [106] b.run: Couldn't connect to Google API client: ConnectionResult{statusCode=API_UNAVAILABLE, resolution=null, message=null}
10-29 23:41:00.417 1752-2357/? E/MDM: [108] b.run: Couldn't connect to Google API client: ConnectionResult{statusCode=API_UNAVAILABLE, resolution=null, message=null}
10-29 23:41:01.599 1293-1304/? I/AccountManagerService: getTypesVisibleToCaller: isPermitted? true
10-29 23:41:01.603 1946-2391/? D/: HostConnection::get() New Host Connection established 0x9c9ffb40, tid 2391
10-29 23:41:02.382 2489-2502/? W/System: ClassLoader referenced unknown path:
10-29 23:41:02.385 2489-2502/? D/: HostConnection::get() New Host Connection established 0x9dafd0e0, tid 2502
10-29 23:41:03.930 1752-2177/? E/MDM: [106] b.run: Couldn't connect to Google API client: ConnectionResult{statusCode=API_UNAVAILABLE, resolution=null, message=null}
10-29 23:42:21.214 2836-2857/? D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
10-29 23:42:21.218 2836-2836/? D/: HostConnection::get() New Host Connection established 0xad77ad90, tid 2836
10-29 23:42:21.319 2836-2857/? D/: HostConnection::get() New Host Connection established 0xb3f883e0, tid 2857
10-29 23:42:22.322 1706-2868/? D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
10-29 23:42:22.340 1706-1706/? D/: HostConnection::get() New Host Connection established 0xab724e20, tid 1706
10-29 23:42:22.490 1706-1706/? I/LatinIME: Starting input. Cursor position = 0,0
10-29 23:42:22.501 1706-2868/? D/: HostConnection::get() New Host Connection established 0xab724aa0, tid 2868
10-29 23:42:24.905 1293-2870/? D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
10-29 23:42:24.941 1293-2870/? D/: HostConnection::get() New Host Connection established 0x9e1bfbe0, tid 2870
10-29 23:42:32.186 1293-1469/? I/ActivityManager: Process com.example.rene.houseenabler (pid 2836) has died
10-29 23:42:32.217 951-2874/? D/: HostConnection::get() New Host Connection established 0xb708bce0, tid 2874
10-29 23:43:06.005 1864-2915/? W/System.err: at com.android.okhttp.Connection.connect(Connection.java:143)
10-29 23:43:06.005 1864-2915/? W/System.err: at com.android.okhttp.Connection.connectAndSetOwner(Connection.java:185)
10-29 23:43:06.005 1864-2915/? W/System.err: at com.android.okhttp.internal.http.HttpEngine.nextConnection(HttpEngine.java:341)
10-29 23:43:06.005 1864-2915/? W/System.err: at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:433)
10-29 23:43:06.005 1864-2915/? W/System.err: at com.android.okhttp.internal.huc.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:114)
10-29 23:43:06.005 1864-2915/? W/System.err: at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getOutputStream(HttpURLConnectionImpl.java:245)
10-29 23:43:06.005 1864-2915/? W/System.err: at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getOutputStream(DelegatingHttpsURLConnection.java:218)
10-29 23:43:06.005 1864-2915/? W/System.err: at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java)
10-29 23:43:06.165 1864-1886/? E/StrictMode: at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:439)
10-29 23:43:06.165 1864-1886/? E/StrictMode: at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:384)
10-29 23:43:06.165 1864-1886/? E/StrictMode: at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:497)
10-29 23:43:06.165 1864-1886/? E/StrictMode: at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getResponseCode(DelegatingHttpsURLConnection.java:105)
10-29 23:43:06.165 1864-1886/? E/StrictMode: at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java)
10-29 23:43:18.718 2973-2989/? D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
10-29 23:43:18.719 2973-2973/? D/: HostConnection::get() New Host Connection established 0xad77ae10, tid 2973
10-29 23:43:18.760 2973-2989/? D/: HostConnection::get() New Host Connection established 0xb401ca30, tid 2989
10-29 23:43:18.810 2973-2989/? W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xab78ca20, error=EGL_SUCCESS
10-29 23:43:18.813 951-2875/? D/: HostConnection::get() New Host Connection established 0xb708bc90, tid 2875


Fold kodeboks ind/udJava kode 




t