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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:28:20+00:00 2026-05-22T16:28:20+00:00

I have a problem which i’m trying to solve, I’ve been trying to fetch

  • 0

I have a problem which i’m trying to solve, I’ve been trying to fetch my data from an intent using mRowId below which I’ve been constantly returned a NullPointerException from fetchDrug() on LogCat.

Doing some troubleshooting using debugging, I’ve realized my variable mRowId is not Null and is pointing to something but I don’t know what its pointing.

How can i check what is my variable mRowId pointing ? Or will normally such variables be gibberish that is incomprehensible?

@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.drug_info);

        //Defining the views
        mDrugText = (TextView) findViewById(R.id.drug);
        mContentText = (TextView) findViewById(R.id.content);

        Bundle extras = getIntent().getExtras();

        mRowId = extras.getLong(DrugsDbAdapter.KEY_ROWID);

        if(mRowId == null) {

            Log.e("mRowId is null", "ok");

        } else {

        Cursor drug = mDbHelper.fetchDrug(mRowId);

        //Managing Cursor to pluck values to display
        startManagingCursor(drug);

        mDrugText.setText(drug.getString(drug.getColumnIndexOrThrow(DrugsDbAdapter.KEY_DRUG)));

        mContentText.setText(drug.getString(drug.getColumnIndexOrThrow(DrugsDbAdapter.KEY_CONTENT)));

    }
    }
  • 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-22T16:28:21+00:00Added an answer on May 22, 2026 at 4:28 pm

    Instead of printf, use the existing log functionality in the SDK.

    Output will appear in the logcat window of Eclipse (probably best option, since it’s reasonably real-time and you can filter the display), or you can pull the logs off the device/emulator manually.

    For example:

    Log.i ( "MyApp", "Drug = " + drug.getString ( drug.getColumnIndexOrThrow ( DrugsDbAdapter.KEY_DRUG ) ) );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have special problem which I am trying to solve using CSS. My HTML
I have the following problem which I'm trying to solve with javascript. I have
I have a problem which I am trying to solve with genetic algorithms. The
I have a problem here which i am trying to solve. The program is
I am trying to solve my heroku problem which it seems to have problem
I have a problem which requires me to parse several log files from a
So I have a rather basic javascript problem which I have been slamming my
I have a problem which I have been bashing my head against for the
I have a problem which I'm pretty sure that I can't solve without going
Im doing some javascript code and im using firefox. i have a problem which

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.