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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T11:30:11+00:00 2026-06-18T11:30:11+00:00

I have listview in screen A once the user clicks on the one of

  • 0

I have listview in screen A once the user clicks on the one of the item in the list it navigates to the next screen where he can see more details of that item which is selected.

User can modify that item in the screen B. One the changes are done once the user come back to screen A that list has to be updated how to do it.

The list I used is a static one.

Code I used are:

ArrayList<ItemDetails> image_details = GetSearchResults();

    final ListView lv1 = (ListView) findViewById(R.id.listV_main);
    lv1.setAdapter(new ItemListBaseAdapter(this, image_details));

    lv1.setOnItemClickListener(new OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> a, View v, int position, long id) { 
            Object o = lv1.getItemAtPosition(position);
            ItemDetails obj_itemDetails = (ItemDetails)o;
            Intent i = new Intent(DemoPastSubstitutions.this,DemoPastSubstitutionsDetail.class);
            i.putExtra("substitutesName", obj_itemDetails.getName());
            i.putExtra("positionCompany", obj_itemDetails.getDesignation());
            i.putExtra("phone", obj_itemDetails.getphone());
            i.putExtra("email", obj_itemDetails.getEmail());
            i.putExtra("Date", obj_itemDetails.getDates());
            i.putExtra("imageNo", obj_itemDetails.getImageNumber());
            startActivity(i);
                }  
    });
}
private ArrayList<ItemDetails> GetSearchResults(){
    ArrayList<ItemDetails> results = new ArrayList<ItemDetails>();
    ItemDetails item_details = new ItemDetails();

        item_details.setName("Diesel Dean");
        item_details.setDates("From 02/19/2013 - 04/03/2013");
        item_details.setDesignation("Manager");
        item_details.setphone("+9164589022");
        item_details.setEmail("diesel.dean@sap.com");
        item_details.setImageNumber(1);

        item_details = new ItemDetails();
        item_details.setName("Kate Hudson");
        item_details.setDates("From 01/23/2013 - 02/15/2013");
        item_details.setDesignation("Manager");
        item_details.setphone("+916458902");
        item_details.setEmail("kate.hudson@sap.com");
        item_details.setImageNumber(2);
        results.add(item_details);

        item_details = new ItemDetails();
        item_details.setName("Kevin James");
        item_details.setDates("From 01/01/2013 - 01/02/2013");
        item_details.setDesignation("Manager");
        item_details.setphone("+9164589023");
        item_details.setEmail("kevin.james@sap.com");
        item_details.setImageNumber(3);
        results.add(item_details);

        item_details = new ItemDetails();
        item_details.setName("Gray Cruz");
        item_details.setDates("From 01/10/2013 - 01/20/2013");
        item_details.setDesignation("Manager");
        item_details.setphone("+9164589025");
        item_details.setEmail("gray.cruz@sap.com");
        item_details.setImageNumber(4);
        results.add(item_details);
            return results;
}

Base adapter code:
private static ArrayList itemDetailsrrayList;

private Integer[] imgid = {
        R.drawable.p1,
        R.drawable.bb2,
        R.drawable.p2,
        R.drawable.bb5,
        R.drawable.bb6,
        R.drawable.d1
        };

private LayoutInflater l_Inflater;

public ItemListBaseAdapter(Context context, ArrayList<ItemDetails> results) {
    itemDetailsrrayList = results;
    l_Inflater = LayoutInflater.from(context);
}

public int getCount() {
    return itemDetailsrrayList.size();
}

public Object getItem(int position) {
    return itemDetailsrrayList.get(position);
}

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

public View getView(int position, View convertView, ViewGroup parent) {
    ViewHolder holder;
    if (convertView == null) {
        convertView = l_Inflater.inflate(R.layout.item_details_view, null);
        holder = new ViewHolder();
        holder.txt_itemName = (TextView) convertView.findViewById(R.id.name);
        holder.txt_itemDescription = (TextView) convertView.findViewById(R.id.itemDescription);
        //holder.txt_itemPrice = (TextView) convertView.findViewById(R.id.price);
        holder.itemImage = (ImageView) convertView.findViewById(R.id.photo);

        convertView.setTag(holder);
    } else {
        holder = (ViewHolder) convertView.getTag();
    }

    holder.txt_itemName.setText(itemDetailsrrayList.get(position).getName());
    holder.txt_itemDescription.setText(itemDetailsrrayList.get(position).getDates());
    holder.itemImage.setImageResource(imgid[itemDetailsrrayList.get(position).getImageNumber() - 1]);


    return convertView;
}

static class ViewHolder {
    TextView txt_itemName;
    TextView txt_itemDescription;
    //TextView txt_itemPrice;
    ImageView itemImage;
}
  • 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-18T11:30:12+00:00Added an answer on June 18, 2026 at 11:30 am
    • Use startActivityForResult() instead of startActivity() and override onActivityResult() in Screen A
    • Pass item index along with the other data to Screen B
    • Once modified in Screen B – Send all the data back along with the index, back to Screen A via a Bundle (use setResult() before finishing the Activity in Screen B).
    • Once you finish Screen B, you’d get a call back in onActivityResult(), where you can extract the data and update your list.
    • After updating the data in your list, don’t forget to call ListAdapter.notifyDataSetChanged();
    • Please note, Since you use static list, you have to pass data back-and-forth
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a listview where each list item can contain 1 or more clickable
I have implemented a list view, every user scroll to bottom screen, it auto
I have a listview on my page that can display 10,000 or more rows.
I have two screens the one which list the records in a listview ListView
I have a listview that displays a list of profiles added by a user.
I would like my screen to have a listview with a header. In my
I have a ListView that sits on the left side of a tablet-size screen.
I have an app using a ListView as a main screen. Each row displays
I have listview control.There is an option to remove selected items.After the user removes
I have listview having customized some textview and one imageview. When I long click

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.