in app billing - google inapp details in android -


i working on google inapp, below code want information of inapp product, how compare arraylist object string,it shows error on loop "cannot convert element type object string"

arraylist skulist = new arraylist();        skulist.add("premiumupgrade");         skulist.add("gas");        bundle queryskus = new bundle();        queryskus.putstringarraylist("item_id_list", skulist);         bundle skudetails = mservice.getskudetails(3, getpackagename(),"inapp", queryskus);         int response = skudetails.getint("response_code");        if (response == 0)        {            arraylist responselist                = skudetails.getstringarraylist("details_list");             (string thisresponse : responselist)            {                jsonobject object = new jsonobject(thisresponse);                string sku = object.getstring("productid");                string price = object.getstring("price");                if (sku.equals("premiumupgrade"))                 {                   // mpremiumupgradeprice = price;                    log.i("price", price);                } else if (sku.equals("gas")) {                    // mgasprice = price;                    log.i("price", price);                }            }        } 

ok have try that: add string definition of arraylist

arraylist<string> responselist                = skudetails.getstringarraylist("details_list"); 

because not define inside array list can't cast blindly.


Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -