Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7009199
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:49:56+00:00 2026-05-27T21:49:56+00:00

I have an android programm which manage a database. It this database, I write

  • 0

I have an android programm which manage a database. It this database, I write the sensor values of my device.

When close the application with the home button, i have a force close error.

Here is my logcat, can you please help me, thank you.

`12-27 10:45:20.827: D/AndroidRuntime(1053): Shutting down VM  
12-27 10:45:20.827: W/dalvikvm(1053): threadid=1: thread exiting with uncaught exception (group=0x40014760)  
12-27 10:45:20.942: E/AndroidRuntime(1053): FATAL EXCEPTION: main  
12-27 10:45:20.942: E/AndroidRuntime(1053): java.lang.NullPointerException  
12-27 10:45:20.942: E/AndroidRuntime(1053):     at android.database.sqlite.SQLiteStatement.releaseAndUnlock(SQLiteStatement.java:283)  
12-27 10:45:20.942: E/AndroidRuntime(1053):     at android.database.sqlite.SQLiteStatement.executeInsert(SQLiteStatement.java:116)  
12-27 10:45:20.942: E/AndroidRuntime(1053):     at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1732)  
12-27 10:45:20.942: E/AndroidRuntime(1053):     at android.database.sqlite.SQLiteDatabase.insert(SQLiteDatabase.java:1605)  
12-27 10:45:20.942: E/AndroidRuntime(1053):     at milos.stationdemesure.CapteursBDD.insertValeursCapteur(CapteursBDD.java:69)  
12-27 10:45:20.942: E/AndroidRuntime(1053):     at milos.stationdemesure.EssaisCapteurs.onProximityChanged(EssaisCapteurs.java:454)  
12-27 10:45:20.942: E/AndroidRuntime(1053):     at milos.stationdemesure.EssaisCapteurs.onSensorChanged(EssaisCapteurs.java:354)  
12-27 10:45:20.942: E/AndroidRuntime(1053):     at android.hardware.SensorManager$ListenerDelegate$1.handleMessage(SensorManager.java:529)  
12-27 10:45:20.942: E/AndroidRuntime(1053):     at android.os.Handler.dispatchMessage(Handler.java:99)
12-27 10:45:20.942: E/AndroidRuntime(1053):     at android.os.Looper.loop(Looper.java:126)  
12-27 10:45:20.942: E/AndroidRuntime(1053):     at android.app.ActivityThread.main(ActivityThread.java:3997)  
12-27 10:45:20.942: E/AndroidRuntime(1053):     at java.lang.reflect.Method.invokeNative(Native Method)  
12-27 10:45:20.942: E/AndroidRuntime(1053):     at java.lang.reflect.Method.invoke(Method.java:491)
12-27 10:45:20.942: E/AndroidRuntime(1053):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)  
12-27 10:45:20.942: E/AndroidRuntime(1053):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)  
12-27 10:45:20.942: E/AndroidRuntime(1053):     at dalvik.system.NativeStart.main(Native Method)
`
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T21:49:57+00:00Added an answer on May 27, 2026 at 9:49 pm

    I feel the issue is either database instance or any other object became null but you are calling some method using that object. Always check for null before using any methods of any object. see the sample example

    example

    if(database != null){
    database.close();
    } 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an android listview filled with items. Every item has a button. This
I have an network application which uses a select loop like this: bool shutdown=false;
I have an Android program which has a RemoteService (different process) and the Application
I have an android program. It has a button which when clicked is supposed
Have a server-socket running in an android application, which I debug using the emulator.
I have Android pet-project DroidIn which utilizes HttpClient 4 (built into Android) to do
I have an android activity in which I'm using tabs. public class UnitActivity extends
I need an Android application which should be able to fetch data from the
i have a simple program on android which is drawing on user touch. here's
I have an Android App which consists on different modules. The Main module is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.