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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:35:51+00:00 2026-05-25T12:35:51+00:00

whit my Activity I display a form like this: <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:orientation=vertical android:layout_width=match_parent android:layout_height=match_parent>

  • 0

whit my Activity I display a form like this:

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView android:id="@+id/textView1" android:layout_height="wrap_content"
    android:layout_width="wrap_content" android:textAppearance="?android:attr/textAppearanceLarge"
    android:text="@string/add_series" android:layout_gravity="center_horizontal"></TextView>
<EditText android:layout_height="wrap_content"
    android:layout_width="match_parent" android:id="@+id/series_name">
    <requestFocus></requestFocus>
</EditText>
<Button android:layout_height="wrap_content" android:id="@+id/button_save"
    android:layout_width="match_parent" android:text="@string/save"></Button>
</LinearLayout>

I have also a method to get this value.

public void onCreate(Bundle savedInstanceState)
{
    super.onCreate(savedInstanceState);
    setContentView(R.layout.add_series);

    final wecDatabasesManager databaseHelper = new wecDatabasesManager(this);

    final Button button_save = (Button) findViewById(R.id.button_save);
    button_save.setOnClickListener(new View.OnClickListener() {
        public void onClick(View v) {
            final EditText series_name = (EditText) findViewById(R.id.series_name);  
            String name = series_name.getText().toString();

            databaseHelper.addSeries(null, name, 2);
        }
    });
}

In my DatabasesManager class i have this method.

public void addSeries(SQLiteDatabase db, String name, int publisher_id)
{
    ContentValues v = new ContentValues();
    v.put(wecSeriesTable.NAME, name);
    v.put(wecSeriesTable.PUBLISHER_ID, publisher_id);
    db.insert(wecSeriesTable.TABLE_NAME, null, v);
}

But when i try to save a form value i have this error:

09-13 22:16:57.751: WARN/dalvikvm(2811): threadid=1: thread exiting with uncaught exception (group=0x40015560)
09-13 22:16:57.761: ERROR/AndroidRuntime(2811): FATAL EXCEPTION: main
09-13 22:16:57.761: ERROR/AndroidRuntime(2811): java.lang.NullPointerException
09-13 22:16:57.761: ERROR/AndroidRuntime(2811):     at zepod.whatelsecomics.databases.wecDatabasesManager.addSeries(wecDatabasesManager.java:102)
09-13 22:16:57.761: ERROR/AndroidRuntime(2811):     at zepod.whatelsecomics.wecSeriesAddActivity$1.onClick(wecSeriesAddActivity.java:25)
09-13 22:16:57.761: ERROR/AndroidRuntime(2811):     at android.view.View.performClick(View.java:2485)
09-13 22:16:57.761: ERROR/AndroidRuntime(2811):     at android.view.View$PerformClick.run(View.java:9080)
09-13 22:16:57.761: ERROR/AndroidRuntime(2811):     at android.os.Handler.handleCallback(Handler.java:587)
09-13 22:16:57.761: ERROR/AndroidRuntime(2811):     at android.os.Handler.dispatchMessage(Handler.java:92)
09-13 22:16:57.761: ERROR/AndroidRuntime(2811):     at android.os.Looper.loop(Looper.java:123)
09-13 22:16:57.761: ERROR/AndroidRuntime(2811):     at android.app.ActivityThread.main(ActivityThread.java:3647)
09-13 22:16:57.761: ERROR/AndroidRuntime(2811):     at java.lang.reflect.Method.invokeNative(Native Method)
09-13 22:16:57.761: ERROR/AndroidRuntime(2811):     at java.lang.reflect.Method.invoke(Method.java:507)
09-13 22:16:57.761: ERROR/AndroidRuntime(2811):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
09-13 22:16:57.761: ERROR/AndroidRuntime(2811):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
09-13 22:16:57.761: ERROR/AndroidRuntime(2811):     at dalvik.system.NativeStart.main(Native Method)
09-13 22:16:57.781: WARN/ActivityManager(68):   Force finishing activity zepod.whatelsecomics/.wecSeriesAddActivity
09-13 22:16:58.321: WARN/ActivityManager(68): Activity pause timeout for HistoryRecord{4076bc68 zepod.whatelsecomics/.wecSeriesAddActivity}

Why?
Can someone help me?

I have just update the code.

  • 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-25T12:35:52+00:00Added an answer on May 25, 2026 at 12:35 pm

    This is the important information from your StackTrace:

    09-13 22:16:57.761: ERROR/AndroidRuntime(2811): java.lang.NullPointerException
    
    09-13 22:16:57.761: ERROR/AndroidRuntime(2811):     at zepod.whatelsecomics.databases.wecDatabasesManager.addSeries(wecDatabasesManager.java:102)
    

    Whatever object(s) your accessing at line 102 in the addSeries method of wecDatabasesManager could potentially be null. Post the addSeries method code if you are unable to quickly figure this one out

    EDIT

    You’re passing a null to addSeries where it’s expecting an instance of SqliteDatabase

    databaseHelper.addSeries(null, name, 2);
    

    and then:

    public void addSeries(SQLiteDatabase db, String name, int publisher_id)
    {
        ...
        db.insert(wecSeriesTable.TABLE_NAME, null, v);
    }
    

    db is null

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

Sidebar

Related Questions

I have this form: http://jsfiddle.net/michelejs/Pt6LQ/ The problem is that I am not be able
I have a Custom usercontrol that I want to enlarge. I tested this whit
How can I do this: Enter on this website ( http://www.samair.ru/proxy/time-01.htm ) and get
I have a Activity entity, this entity can have several Task. Here the code
I whant to do something like this: SELECT s.name, COUNT(r.request_log_id) AS NumberOfRequests FROM station
I'm low level as3 programmer and I need help whit this code: I have
I have a simple hierarchic model whit a Person and RunningScore as child. this
What is this error when I SiteMapPath and Configure whit siteMap.of course when I
im starting whit Nhibernate and have managed to get a few examples working, but
I have a problem whit binding in wpf i have a textbox where i

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.