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 7974381
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T08:21:10+00:00 2026-06-04T08:21:10+00:00

I am getting this in LogCat: 05-20 17:16:34.721: E/AndroidRuntime(30461): FATAL EXCEPTION: main 05-20 17:16:34.721:

  • 0

I am getting this in LogCat:

05-20 17:16:34.721: E/AndroidRuntime(30461): FATAL EXCEPTION: main
05-20 17:16:34.721: E/AndroidRuntime(30461): java.lang.NullPointerException
05-20 17:16:34.721: E/AndroidRuntime(30461):    at android.database.sqlite.SQLiteStatement.releaseAndUnlock(SQLiteStatement.java:290)
05-20 17:16:34.721: E/AndroidRuntime(30461):    at android.database.sqlite.SQLiteStatement.executeUpdateDelete(SQLiteStatement.java:96)
05-20 17:16:34.721: E/AndroidRuntime(30461):    at android.database.sqlite.SQLiteDatabase.updateWithOnConflict(SQLiteDatabase.java:1810)
05-20 17:16:34.721: E/AndroidRuntime(30461):    at android.database.sqlite.SQLiteDatabase.update(SQLiteDatabase.java:1761)
05-20 17:16:34.721: E/AndroidRuntime(30461):    at com.kickinglettuce.debtplannerpro.DebtDataSource.updateDebt(DebtDataSource.java:130)
05-20 17:16:34.721: E/AndroidRuntime(30461):    at com.kickinglettuce.debtplannerpro.manageDebts$4.onClick(manageDebts.java:184)
05-20 17:16:34.721: E/AndroidRuntime(30461):    at android.view.View.performClick(View.java:3511)
05-20 17:16:34.721: E/AndroidRuntime(30461):    at android.view.View$PerformClick.run(View.java:14105)
05-20 17:16:34.721: E/AndroidRuntime(30461):    at android.os.Handler.handleCallback(Handler.java:605)
05-20 17:16:34.721: E/AndroidRuntime(30461):    at android.os.Handler.dispatchMessage(Handler.java:92)
05-20 17:16:34.721: E/AndroidRuntime(30461):    at android.os.Looper.loop(Looper.java:137)
05-20 17:16:34.721: E/AndroidRuntime(30461):    at android.app.ActivityThread.main(ActivityThread.java:4447)
05-20 17:16:34.721: E/AndroidRuntime(30461):    at java.lang.reflect.Method.invokeNative(Native Method)
05-20 17:16:34.721: E/AndroidRuntime(30461):    at java.lang.reflect.Method.invoke(Method.java:511)
05-20 17:16:34.721: E/AndroidRuntime(30461):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
05-20 17:16:34.721: E/AndroidRuntime(30461):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
05-20 17:16:34.721: E/AndroidRuntime(30461):    at dalvik.system.NativeStart.main(Native Method)

Here is the code associated with it:

protected void onListItemClick(ListView l, View v, int position, long id) {

    List<Debt> values = datasource.getAllDebt();
            datasource.open();

    Debt item = values.get(position);
    final long boxId = item.getId();
    // final String BoxId = String.valueOf(boxId);
    final String BoxName = item.getName();
    final String BoxBalance = item.getBalance();
    final String BoxApr = item.getApr();
    final String BoxPayment = item.getPayment();

    // set up dialog
    final Dialog dialog = new Dialog(manageDebts.this);
    dialog.setContentView(R.layout.custom_dialog);
    dialog.setTitle("Edit Debt Details");
    dialog.setCancelable(true);

    // set up text
    TextView tv1 = (TextView) dialog.findViewById(R.id.textView1);
    TextView tv2 = (TextView) dialog.findViewById(R.id.textView2);
    TextView tv3 = (TextView) dialog.findViewById(R.id.textView3);
    TextView tv4 = (TextView) dialog.findViewById(R.id.textView4);
    EditText et1 = (EditText) dialog.findViewById(R.id.editText1);
    EditText et2 = (EditText) dialog.findViewById(R.id.editText2);
    EditText et3 = (EditText) dialog.findViewById(R.id.editText3);
    EditText et4 = (EditText) dialog.findViewById(R.id.editText4);

    tv1.setText("Debt Description");
    tv2.setText("Balance");
    tv3.setText("APR");
    tv4.setText("Monthly Payment");

    et1.setText(BoxName);
    et2.setText(BoxBalance);
    et3.setText(BoxApr);
    et4.setText(BoxPayment);

    // set up button
    Button button = (Button) dialog.findViewById(R.id.button1);
    button.setOnClickListener(new OnClickListener() {
        public void onClick(View v) {


            datasource.updateDebt(Long.valueOf(boxId), BoxName, BoxBalance, BoxApr,
                    BoxPayment);
            dialog.dismiss();

        }
    });

    datasource.close();

    dialog.show();
}

And the Update Method in my database class:

public boolean updateDebt(long updateId, String debtName, String debtTotal,
        String debtApr, String paymentGoal) {

     ContentValues values = new ContentValues();
     values.put(MySQLiteHelper.COLUMN_DEBT_NAME, debtName);
     values.put(MySQLiteHelper.COLUMN_DEBT_TOTAL, debtTotal);
     values.put(MySQLiteHelper.COLUMN_APR, debtApr);
     values.put(MySQLiteHelper.COLUMN_PAYMENT, paymentGoal);
     String whereClause = MySQLiteHelper.COLUMN_ID + " = ?";
     String[] whereArgs = new String[]{ String.valueOf(updateId) };
     return database.update(MySQLiteHelper.TABLE_DEBT,
             values, whereClause, whereArgs) > 0;
}

Any suggestions?

  • 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-06-04T08:21:12+00:00Added an answer on June 4, 2026 at 8:21 am

    Looks like your trying to access the db when it’s been closed. Perhaps placing datasource.open() at the beginning of onCreate and datasource.close() at the end of onCreate() and calling them each just once in your class would solve your problem.

    If you are editing, creating and deleting items in your activity requiring multiple calls to your database, consider calling datasource.open() at the beginning of a method that accesses the database and then close() at the end of of that method.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am getting this LogCat: 06-22 15:30:53.731: E/AndroidRuntime(2389): java.lang.NumberFormatException: Invalid float: null 06-22 15:30:53.731:
im getting an error from logcat: 01-13 17:53:25.368: E/AndroidRuntime(3235): Caused by: java.lang.NullPointerException 01-13 17:53:25.368:
getting this error in logcat 09-15 14:38:09.944: ERROR/AndroidRuntime(1065): FATAL EXCEPTION: AsyncTask #1 09-15 14:38:09.944:
I am getting this exception in database Leak Found my LOGCAT Shows this: 02-17
I am getting this exception in the LogCat: Unable to start service Intent {
I am getting a NullPointerException becauase of this LogCat message: 02-17 13:01:10.766: W/System.err(950): org.json.JSONException:
I am getting the IllegalAccessError while running Android instrumentation tests. This is Logcat output:
I can't figure out why I'm getting this error in logcat: 02-14 15:44:42.470: E/ActivityThread(32164):
I tried to follow this instruction: http://wiki.phonegap.com/w/page/16494774/Getting-started-with-Android-PhoneGap-in-Eclipse I can run the example but when
I'm a noob to android. and I am getting an illegal argument exception when

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.