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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T00:52:33+00:00 2026-06-03T00:52:33+00:00

I am fetching an array which displays itemimage, itemname, price, qty in a custom

  • 0

I am fetching an array which displays itemimage, itemname, price, qty in a custom listview. Now I am placing one more field, total, which is calculated by multiplying price and quantity.

I am using this code:

public class CustomAdapter extends BaseAdapter
  {
    integer[] a;
public static ArrayList<String> arr1=new ArrayList<String>();
public static ArrayList<String> itemprice=new ArrayList<String>();
public static ArrayList<Bitmap> itemimage=new ArrayList<Bitmap>();
public Context Context;
private LayoutInflater inflater;
String total;
    HashMap<String, String> map = new HashMap<String, String>();
    public CustomAdapter(Context context, ArrayList<String> arr,ArrayList<String> price,ArrayList<Bitmap> image) 
    {
        Context=context;
        inflater=LayoutInflater.from(context);
        arr1=arr;
        itemprice=price;
        itemimage=image;
        System.out.println(itemprice);
        System.out.println("arr: " + arr.size());

      for(int i=0;i<price.size();i++)
      {

          String amonut=price.get(i);
          int x=Integer.parseInt(amonut);

      }

    }
    public int getCount() 
    {
        // TODO Auto-generated method stub
        return arr1.size();

    }

    public Object getItem(int position) 
    {
        // TODO Auto-generated method stub
        return arr1.get(position);
    }

    public long getItemId(int position) 
    {
        // TODO Auto-generated method stub
        return position;
    }

    public View getView(int position, View convertView, ViewGroup parent) 
        {
        System.out.println(arr1.get(position));

          final  ViewHolder holder;

            if (convertView == null) 
            {
                convertView = inflater.inflate(R.layout.selecteditemlistview, null);
                holder = new ViewHolder();

                holder.textViewSelectedText = (TextView)convertView.findViewById(R.id.selectedtext);
                holder.price=(TextView)convertView.findViewById(R.id.selectitemprice);
                holder.image=(ImageView)convertView.findViewById(R.id.selectitemimagge);
                holder.qty=(EditText)convertView.findViewById(R.id.selectqty);
                holder.total=(TextView)convertView.findViewById(R.id.totalamount);
                convertView.setTag(holder);
            }
            else 
            {
                holder = (ViewHolder) convertView.getTag();
            }
            String amount=holder.qty.getText().toString();

            holder.textViewSelectedText.setText(arr1.get(position));
            holder.price.setText(itemprice.get(position));
            holder.image.setImageBitmap(itemimage.get(position));

            return convertView;     
        }

        class ViewHolder
        {
            TextView textViewSelectedText = null;
            TextView price=null;
            ImageView image=null;
            EditText qty=null;
            TextView total=null;
        }      
 }

I want to multiply int x and String amount and assign the result as text to total.

  • 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-03T00:52:35+00:00Added an answer on June 3, 2026 at 12:52 am
    ans = x * Integer.parseInt(amount); or
    
    ans = x * Double.parseDouble(amount);
    
    total = String.valueOf(ans); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am fetching array of dates which come between two date.. and i am
I am having one array where i am fetching data from database for some
I am fetching an array and I would like to assign attributes of items
In my rails app the model is fetching some XML and returning an array.
I am fetching the current date & time using NOW() in mysql. I want
I have multiple foreach loops through which i am fetching the work history ,
i am fetching a data from sqlite in android which is as follows URL
I wrote a piece which was fetching data for me correctly when I was
I am fetching an array of floats from my database but the array I
Hello everyone please help me out regarding this query which is fetching the data

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.