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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T09:25:12+00:00 2026-05-29T09:25:12+00:00

I’m sure glad this site is here. It has helped me out every time.

  • 0

I’m sure glad this site is here. It has helped me out every time.

So my new problem is, I have passed a value from one activity to another and set that value to a text view. The value is always numeric. I then use “on menu item selected” to pass that value to another activity and set that value to a text view. What I’m looking to do is use that value (which is numeric and represents the row id associated with the data) to query the database and return the row associated with the numeric value mentioned earlier. Then populate the appropriate edit text or text views of the same activity.

Here is where I call for the text value (tv1)

private void populateFields() {

if (tv1!=null) {
    Cursor note = mDbHelper.fetchRow(tv1);
    startManagingCursor(note);

    //rowid.setText(note.getString(
        //  note.getColumnIndexOrThrow(DatabaseManager.KEY_ROWID)));
    txtbox28.setText(note.getString(
           note.getColumnIndexOrThrow(DatabaseManager.KEY_NAME)));
    txtbox1.setText(note.getString(
            note.getColumnIndexOrThrow(DatabaseManager.NICBASEML)));
    txtbox4.setText(note.getString(
            note.getColumnIndexOrThrow(DatabaseManager.NICDROPS)));
    txtbox8.setText(note.getString(
            note.getColumnIndexOrThrow(DatabaseManager.NICPERCT)));

and the query

public Cursor fetchRow(TextView tv1) throws SQLException {

            Cursor mCursor =

                mDb.query(true,DATABASE_TABLE, new String[] {KEY_ROWID, KEY_NAME,
                        NICBASEML, NICDROPS, NICPERCT, PGML, PGDROPS,PGPERCT,
                        VGML,VGDROPS,VGPERCT, WAPML, WAPDROPS, WAPPERCT, 
                        FLV1NAME, FLV1ML, FLV1DROPS, FLV1PERCT,
                        FLV2NAME, FLV2ML, FLV2DROPS, FLV2PERCT,
                        FLV3NAME, FLV3ML, FLV3DROPS, FLV3PERCT,
                        FLV4NAME, FLV4ML, FLV4DROPS, FLV4PERCT,
                        DROPSML, AMOUNT, FINALNIC, BPG, BVG, BASENIC}, KEY_ROWID + "=" + tv1,  null, null, null, null, null);

            if (mCursor != null) {
                mCursor.moveToFirst();
            }
            return mCursor;

        }

this is the error I get now.

02-07 12:14:16.120: E/AndroidRuntime(2713): Caused by: android.database.sqlite.SQLiteException: near “@405dcd48”: syntax error: , while compiling: SELECT DISTINCT _id, name, nicbaseml, nicdrops, nicperct, pgml, pgdrops, pgperct, vgml, vgdrops, vgperct, wapml, wapdrops, wapperct, flv1name, flv1ml, flv1drops, flv1perct, flv2name, flv2ml, flv2drops, flv2perct, flv3name, flv3ml, flv3drops, flv3perct, flv4name, flv4ml, flv4drops, flv4perct, dropsml, amount, finalnic, bpg, bpg, basenic FROM recipes WHERE _id=android.widget.TextView@405dcd48

hmmm stuck on this one. Where is the error @405dcd48?

  • 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-29T09:25:13+00:00Added an answer on May 29, 2026 at 9:25 am

    Here is the solution. It took many hours (2 days) to figure this out and then it was a dhooo! hand to the face moment. But never the less, here is the solution for others that have the same issue. In your declaration for populating the fields (in this case fetch(row).

    Do this:

    private void populateFields() {
    
    String row = tv1.getText().toString();//String to get the textview of the rowid
    
            if (tv1!= null) { //Checking to see if the field is not empty to proceed
    
                Cursor note = mDbHelper.fetchRow(row);//Calling my cursor to manage data
                startManagingCursor(note);//Starting the management and retrieve data
    

    You will get the error as above and then a null pointer exception. This can be fixed by declaring your fields –>(txtbox1= (TextView) findViewById(R.id.textView22);.

    Your database manager needs to be configured for a String.

    Like this:

    public Cursor fetchRow(String row) throws SQLException {
    

    Now you can retrieve the data from the row using a textview or editview value equal to the row id of the data you are looking for.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have some data like this: 1 2 3 4 5 9 2 6
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
That's pretty much it. I'm using Nokogiri to scrape a web page what has

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.