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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:54:46+00:00 2026-06-15T23:54:46+00:00

I have a list view populate with numbers, and a edit text that sum

  • 0

I have a list view populate with numbers, and a edit text that sum the amount of numbers in the list view, I have written a implementation of ontouch, to delete rows in the list view, my question is: is there a way to delete the value that I delete in the list view on the edit text. for example if I delete the row 7 of 10 rows and its has a value of 5, and the amount is 35 display on the edit text, now the edit text must have 30.

thank you I will appreciate it

here some codes:

 private void showListViewData() {

    String z = "";
    String zQN = "Nu";
    String zPL = "Pl";  
    String zTR = "Tr";

    int x = Integer.parseInt(inJugada.getText().toString());
    int y = Integer.parseInt(inValor.getText().toString());

    String s = Integer.toString(x); 

    inJugada.setText(s);

    inValor.setText(String.valueOf(y));

   if(s.length() == 2){
       z = zQN;

   }else if(s.length() == 4){

       z = zPL;

   }else if(s.length() == 6){
       z = zTR;
   }

    for(int i=0; i<mData.size(); i++)
        mData.get(i);

    mData.add(new Data(z, x, y));
    Collections.sort(mData);
    Collections.synchronizedCollection(mData);

    // add new data to list and refresh
    mAdapter.notifyDataSetChanged();
  • 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-15T23:54:47+00:00Added an answer on June 15, 2026 at 11:54 pm

    If you need to delete item whit ontouch, or click you will need adapter and onClick. I have list of arrays where i set the different variables “ArrayList items”. Every time i get the variable i put it in this “items”, then whit adapter i display in list view and on click i can make what ever i want whit item[i].

    MyAdapter adapter = new MyAdapter(getActivity(), R.layout.row, items);
        ListView myList = (ListView) view.findViewById(R.id.list);
        myList.setAdapter(adapter);
        myList.setOnItemClickListener(new OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
                File f = new File(path.get(arg2));
    
                //your delete code here for clicked item
        }});
    

    then you can call a method to calculate your variables whit simple for method.

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

Sidebar

Related Questions

I have AutoCompleteTextView attached to my view, and used ArrayAdapter to populate for list
I have an activity that extends ListView. I populate my list with the results
I have a list view inside of an alertDialog. I populate my list view
I have used a custom array adapter to populate my list view.The problem i
I have a list view that shows contacts - name and number are the
I've got a list view and I have to populate it with states as
I have list view with names and numbers and checkbox populated from contacts with
I have a list view that show a list of items...well not all of
I have list view and its adapter stored as global variables. I am not
I have an MVC view that contains a JQuery UI dialog that can be

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.