How to show Tapped Product Information in WishProductDetails.java

Like: we see in Cart Apps, when user selects some item(s) and at very last stage he/she wants to change quantity of an item, here we allow user to Tap on Item in List View to update quantity of an item, and once user tap on item in list view, we show him/her existing detail of an item, which has been tapped....in a same way i want to allow user to tap on item and want to show him existing detail for his item....Just want to show existing product information which has been tapped by user in WishProductDetails.java

Still i am able to show WishProductDetails.java but not able to show Tapped Item Details in Activity..

I am using below code to show existing Item details in WishProductDetails.java which i have clicked in Cart Activity using List View Item row...

        HashMap<String, String> item = Constant.wishProducts.get(position);
        Log.d("CartAdapter", "onClick :: " + item);
        Intent myIntent = new Intent 
        (activity, WishProductDetails.class);
        Log.d("CartAdapter", "Intent :: " + myIntent);
        myIntent.putExtra("Item", item);
        activity.startActivity(myIntent);  

Work related to add item into Cart and accept quantity of an item, all such works i am doing WishProductDetails.java

Now i want whenever user do click on any of the ListView Item row, i need to show that particular item in WishProductDetails.java activity along with existing details.

Answers


I am guessing that you are using an ImageButton to remove an item from cart, i have never worked on this kind of project but i am writing what i think, like:

 mImgBtnDelete = (ImageButton) vi
            .findViewById(R.id.mImgBtnDelete);
    mImgBtnDelete.setOnClickListener(new OnClickListener() {

        public void onClick(View v) {
            // TODO Auto-generated method stub

            Constant.wishproducts.remove(position);
            notifyDataSetChanged();
}

Edit #2

Code to Update an Item using on ListView Item Row

I think in your Adapter class, you should add code something like below, to update quantity of an item while click on item row, but very frank i don't know how to open that particular item in WishProductDetail.java (where you are allowing user to enter quantity)

  public View getView(final int position, View convertView, ViewGroup parent) {
    // TODO Auto-generated method stub
    View vi = convertView;
    if (convertView == null)
        vi = inflater.inflate(R.layout.cart, null);
        vi.setClickable(true);
        vi.setFocusable(true);
        vi.setOnClickListener(new OnClickListener() {


  @Override
        public void onClick(View v) 
        {
            HashMap<String, String> prod = Constant.wishproducts.get(position);
        Intent mViewCartIntent = new Intent
                (activity,ProductInformationActivity.class);             
        mViewCartIntent.putExtra("product", prod);
        activity.startActivity(mViewCartIntent);           
        }
    });

Need Your Help

How to tell AC_SUBST to not substitute variables in arguments?

c++ autotools autoconf automake m4

I'm using autotools to build my project and I'd like to globally set AM_CPPFLAGS to -I$(top_srcdir)/include.

How do I remove a node in xml using ElementTree in Python?

python xml elementtree

I've read the remove example here and the example here is not applicable to me.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.