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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T09:42:15+00:00 2026-06-01T09:42:15+00:00

i am fetching text from mysql server database in customized ListView . In customized

  • 0

i am fetching text from mysql server database in customized ListView. In customized list view i append all text to edittext. how to get edittext value and store it on textview while content of edittext is changed. i want changed edittext values please help me

        Main.java(here i can pass json array as constructor to EditMainMenulistview.java)
        JSONArray json = jArray.getJSONArray("mainmenu");
        list=(ListView)findViewById(R.id.mainmenulist);
         adapter=new MainMenulist(this, json);
         list.setAdapter(adapter);

here i can place button update//button in Main.java

EditMainMenulistview.java

    public class EditMainMenulistview extends BaseAdapter {
protected static Context Context = null;
int i;
public String editnewmainmenu, menuname,edittext;
String qrimage;
Bitmap bmp, resizedbitmap;
Bitmap[] bmps;
Activity activity = null;
private LayoutInflater inflater;

private ImageView[] mImages;
String[] itemimage;
TextView[] tv;
String itemname, itemcode;
public String[] itemnames, itemcodes;
HashMap<String, String> map = new HashMap<String, String>();

public EditMainMenulistview(Context context, JSONArray imageArrayJson) {
    Context = context;
    // inflater =
    // (LayoutInflater)activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    // imageLoader=new ImageLoader(activity);
    inflater = LayoutInflater.from(context);
    this.mImages = new ImageView[imageArrayJson.length()];
    this.bmps = new Bitmap[imageArrayJson.length()];
    this.itemnames = new String[imageArrayJson.length()];
    this.itemcodes = new String[imageArrayJson.length()];

    try {

        for (i = 0; i < imageArrayJson.length(); i++) {
            JSONObject image = imageArrayJson.getJSONObject(i);
            qrimage = image.getString("menuimage");
            itemname = image.getString("menuname");
            itemcode = image.getString("menucode");
            itemnames[i] = itemname;
            itemcodes[i] = itemcode;

            byte[] qrimageBytes = Base64.decode(qrimage.getBytes());

            bmp = BitmapFactory.decodeByteArray(qrimageBytes, 0,
                    qrimageBytes.length);
            int width = 100;
            int height = 100;
            resizedbitmap = Bitmap.createScaledBitmap(bmp, width, height,
                    true);
            bmps[i] = bmp;

            mImages[i] = new ImageView(context);
            mImages[i].setImageBitmap(resizedbitmap);

            mImages[i].setScaleType(ImageView.ScaleType.FIT_START);

            // tv[i].setText(itemname);
        }
        System.out.println(itemnames[i]);
        System.out.println(map);

    } catch (Exception e) {
        // TODO: handle exception
    }
}

public int getCount() {
    return mImages.length;
}

public Object getItem(int position) {
    return position;
}

public long getItemId(int position) {
    return position;
}

public View getView(final int position, View convertView, ViewGroup parent) {

    View vi = convertView;

    vi = inflater.inflate(R.layout.editmainmenulist, null);

    EditText text = (EditText) vi.findViewById(R.id.editmaimenu);
    ImageView image = (ImageView) vi.findViewById(R.id.menuimage);


    image.setImageBitmap(bmps[position]);

    text.append(itemnames[position]);
     edittext = text.getText().toString();
    System.out.println(edittext);
    //Toast.makeText(Context, edittext, Toast.LENGTH_LONG).show();

    return vi;

}

}

what i am changed text in EditMaiMenulisview i click button(Update) Main.java i want print what i have been changed in Edittext. please replay

  • 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-01T09:42:16+00:00Added an answer on June 1, 2026 at 9:42 am

    Please use the following code

    public View getView(final int position, View convertView, ViewGroup parent) {
        View vi = convertView;
        if(vi == null) {
    
             vi = inflater.inflate(R.layout.editmainmenulist, null);
        }
    
        EditText text = (EditText) vi.findViewById(R.id.editmaimenu);
        ImageView image = (ImageView) vi.findViewById(R.id.menuimage);
        TextView tv = (TextView) vi.findViewById(R.id.<textViewId>); //replace with  
                                                                      //textView ID
    
        image.setImageBitmap(bmps[position]);
    
        text.append(itemnames[position]);
         edittext = text.getText().toString();
    text.addTextChangedListener(new TextWatcher() {
    
        public void afterTextChanged(Editable s) {
             Log.v("LOG","After text change value "+s.toString());
        }
    
        public void beforeTextChanged(CharSequence s, int start, int count,
                int after) {
            // TODO Auto-generated method stub
    
        }
    
        public void onTextChanged(CharSequence s, int start, int before,
                int count) {
            // TODO Auto-generated method stub
    
        }
    
    });
         System.out.println(edittext);
            //Toast.makeText(Context, edittext, Toast.LENGTH_LONG).show();
         tv.setText(edittext);
       return vi;
    }
    

    You can get the value in afterTextChange method

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

Sidebar

Related Questions

I am fetching some value from another page using jQuery .get() like this <input
I'm currently fetching data from a MySQL database using JDBC and executeQuery . One
i am fetching data from database into table view in database table some roe
I am fetching a json from server, json have some attributes where the value
I'm fetching a row of data from a mysql-server using php, then encode it
I having trouble cause I am fetching some text from the db(mysql), that text
I'm fetching some data from an MSSQL table using the mssql_fetch_object, but the text
I'm fetching data from all 3 tables at once to avoid network latency. Fetching
I am fetching the datas from the database...And the datas are displayed as dropdownmenu
I am fetching lots of thumbnails from a remote server and displaying them in

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.