-3

How to check the MRP prices and selling prices are equal or not equal. Suppose if MRP price and Selling price are equal have to display only selling price in text view otherwise both MRP price and selling price must display in text view.

Program:

 String sellingprice=prodcutitems.getString("selling_price");
  String productMrp=prodcutitems.getString("mrp_price");
   if(productMrp==sellingprice) {
     existingprice[k].setText(sellingprice);
                                }
           else
                               {
    existingprice[k].setText(sellingprice);
   price[k].setText(productMrp);
   existingprice[k].setPaintFlags(existingprice[k].getPaintFlags()|Paint.STRIKE_THRU_TEXT_FLAG);
                               }
                                                        }

I have been checking like this only else part can worked. Thanks in Advance

ArK
  • 20,698
  • 67
  • 109
  • 136
user2524
  • 31
  • 6

1 Answers1

0

Try This....

Program:

String sellingprice=prodcutitems.getString("selling_price");
  String productMrp=prodcutitems.getString("mrp_price");
   if(productMrp.equalsIgnoreCase(sellingprice)) {
     existingprice[k].setText(sellingprice);
                                }
           else
                               {
    existingprice[k].setText(sellingprice);
   price[k].setText(productMrp);
   existingprice[k].setPaintFlags(existingprice[k].getPaintFlags()|Paint.STRIKE_THRU_TEXT_FLAG);
                               }
}
Kaushal Patel
  • 338
  • 4
  • 19