android - When I switch one activity to another activity then inApp purchase dosen't work -
////// in first activity @override public void onclick(view v) { if(v==btn){ intent i= new intent(chatactivity.this ,mainactivity.class); i.putextra("name",0); startactivity(i); } } //////////// in second activity oncreate method intent i=getintent(); int name=i.getintextra("name",10); demo(name); ////// in demo method private void demo(int name) { if(name==0){ purchase(); } } ////// in purchase method public void purchase(){ bp.purchase(mainactivity.this,product_id); showtoast("in purchase method !!!"); }
inapp purchase classes include in application first statement not working , second working.if separate run second class without switch work properly.plz help.
change onclick() method shown below:
@override public void onclick(view v) { if(v.getid()== btn){// can used v.getid() == r.id.btn intent i= new intent(chatactivity.this ,mainactivity.class); i.putextra("name",0); startactivity(i); } }
hope helps.
Comments
Post a Comment