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

  • Home
  • SEARCH
  • 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 8937965
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:30:47+00:00 2026-06-15T10:30:47+00:00

is it possible to update the text in edittext when it’s already set? i’ve

  • 0

is it possible to update the text in edittext when it’s already set? i’ve filled up my edittext with the name and phone number of a person from my listview, and i want the user to edit these details. when i tried to enter for example a surname and click the update button, it cannot save my input and still saved the one that i passed coming from my listview.

EditText sqlName = (EditText)findViewById(R.id.editName);
    EditText sqlNumber = (EditText)findViewById(R.id.editNumber);
    name = CustomListView.name;
    num = CustomListView.number;
    Button bUpdate = (Button)findViewById(R.id.editUpdate);
    Button bView = (Button)findViewById(R.id.editView);
    sqlName.setText(name);
    sqlNumber.setText(num);
    nameChanged = sqlName.getText().toString();
    numChanged = sqlNumber.getText().toString();
    bUpdate.setOnClickListener(new OnClickListener() {

        public void onClick(View arg0) {
            GroupDb info = new GroupDb(EditDetails.this);
            info.open();
            long rowid = info.getRowId(name, num);
            Toast.makeText(getApplicationContext(), nameChanged+" "+numChanged+" ", Toast.LENGTH_LONG).show();
            info.updateNameNumber(rowid, nameChanged, numChanged);
            Toast.makeText(getApplicationContext(), "Update Successful!", Toast.LENGTH_LONG).show();
            info.close();
            }
        });
  • 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-15T10:30:47+00:00Added an answer on June 15, 2026 at 10:30 am

    The problem with your code is that you are fetching the values from the EditTexts even before they were updated. You need to wait for the user to press the update button and then get the text from the EditTexts and pass them to the database to save.

    Try the following code.

        EditText sqlName = (EditText)findViewById(R.id.editName);
        EditText sqlNumber = (EditText)findViewById(R.id.editNumber);
        name = CustomListView.name;
        num = CustomListView.number;
        Button bUpdate = (Button)findViewById(R.id.editUpdate);
        Button bView = (Button)findViewById(R.id.editView);
        sqlName.setText(name);
        sqlNumber.setText(num);
        bUpdate.setOnClickListener(new OnClickListener() {
    
            public void onClick(View arg0) {
                nameChanged = sqlName.getText().toString();
                numChanged = sqlNumber.getText().toString();
                GroupDb info = new GroupDb(EditDetails.this);
                info.open();
                long rowid = info.getRowId(name, num);
                Toast.makeText(getApplicationContext(), nameChanged+" "+numChanged+" ", Toast.LENGTH_LONG).show();
                info.updateNameNumber(rowid, nameChanged, numChanged);
                Toast.makeText(getApplicationContext(), "Update Successful!", Toast.LENGTH_LONG).show();
                info.close();
                }
            });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

During installation, it's possible to update the InnoSetup wizard status text from inside the
Using JNBridge is it possible to update a JTextField's Text Property from a .Net
Is is possible to update the text 'changethis' in below div using jquery ?
Is it possible to update a different ODBC database from withing a SQL Server
Is it possible to keep checking a MySQL database and then update text? I'm
Is it possible to update the content (e.g. a text) in a custom dialog
Possible Duplicate: How to update GUI from another thread in C#? I have form
I want to run an update on a field to replace <div>[Any text]</div> to
Possible Duplicate: jQuery: get the file name selected from <input type=file /> I have
I'm trying to write a WPF application that will update a set of text

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.