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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:44:25+00:00 2026-05-27T08:44:25+00:00

I have a page with a number edit texts, i want to populate these

  • 0

I have a page with a number edit texts, i want to populate these with columns of a raw with the row id equaling a textview value… this is what i have so far in the edit text page.

public class CBCreate extends Activity   {

EditText EditRecipe,EditRecipe2,EditRecipe3;
Button Rname;
CBDataBaseHelper entry;
TextView RowIDText;
Cursor c;
String name;
String category;
String description;
//final String SQL_STATEMENT = "SELECT Recipe_Name, Recipe_Category, Recipe_Description FROM RecipeData WHERE _id = " + RowIDText ;


public void onCreate(Bundle savedInstanceState) {

    super.onCreate(savedInstanceState);
    setContentView(R.layout.create); // sets the content view to main

    EditRecipe = (EditText) findViewById(R.id.editText1);
    EditRecipe2 = (EditText) findViewById(R.id.editText2);
    EditRecipe3 = (EditText) findViewById(R.id.editText3);
    RowIDText = (TextView) findViewById(R.id.RowID);
    Rname = (Button) findViewById(R.id.RecipeName);
    String RowID;
try{
    Bundle extras = getIntent().getExtras(); 

    if (extras != null) {
        RowID = extras.getString("SELECTED");
        RowIDText.setText(RowID);
    }

    if (RowIDText != null){
        entry = new CBDataBaseHelper(this);
        String s = RowIDText.getText().toString();
        int ID = Integer.parseInt(s);
        entry.open();
        Cursor cursor = entry.fetchRow(ID);

        if (cursor.moveToFirst()){ // data?
           name = cursor.getString(cursor.getColumnIndex(CBDataBaseHelper.KEY_NAME));
    }
        entry.close();
        EditRecipe.setText(name);
        EditRecipe2.setText(category);
        EditRecipe3.setText(description);

    }
    }catch (Exception e){
        String error = e.toString();
        Dialog d = new Dialog(this);
        d.setTitle("darn");
        TextView tv = new TextView(this);
        tv.setText(name);
        d.setContentView(tv);
        d.show();
    }
}

public void doIt(View view) {

            String Name = EditRecipe.getText().toString();
            String description = EditRecipe.getText().toString();
            String category = EditRecipe.getText().toString();
            entry = new CBDataBaseHelper(CBCreate.this);
            entry.open();
            entry.createEntry(Name, description, category);
            entry.close();
            EditRecipe.setText("");
            EditRecipe2.setText("");
            EditRecipe3.setText("");

}

public void goBack(View view){

    Intent myIntent = new Intent(this, CBFilter.class);
    startActivity(myIntent);


}

}

and then this is what i have within the database helper class… i think i want to call this method?

    public Cursor fetchRow(long rowId) throws SQLException {
    Cursor mCursor = mydatabase.query(true, DATABASE_TABLE, new String[] { KEY_ROWID,
            KEY_CATEGORY, KEY_DESCRIPTION }, KEY_ROWID + "="
            + rowId, null, null, null, null, null);
    if (mCursor != null) {
        mCursor.moveToFirst();
    }
    return mCursor;

}
  • 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-27T08:44:26+00:00Added an answer on May 27, 2026 at 8:44 am

    I would use mydatabase.rawquery(QUERY) instead of the cursors query method. Its easier for SQL developers I think. Anyways, once you have your values in the cursor, you can do this

    EditRecipe.setText(cursor.getString(0));
    EditRecipe2.setText(cursor.getString(1));
    

    Where 0 represents the first column in your returned table. You would put that code after your mCursor.moveToFirst();

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

Sidebar

Related Questions

I have an asp page in which the are number of listboxes.I want to
I have a page that has a large image on it with a number
I have two tables, one contains the page/heading number and the heading text, the
I have a dynamic page that gets a certain number of results for rooms
I have a web page where people are able to post a single number
In a simple html page I have: <SCRIPT> function Clicker(number){ if (number == 1)
I have a number of iframes calling a function in my main page. Is
I have a number of elements on a web page, that are scattered, meaning
I have n number of select elements in an html page that are used
I have a number of dropdowns and divs that are hidden when the page

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.