인앱빌링 관련해서 아이템 적용해서 앱 만들어 테스트 하는 중인데요..문제가 발생했어요 ㅠ

다름이 아니라

 

  switch(v.getId()){
  case R.id.imagebutton1:
   if(check[0] == true){
    Intent manIntent = new Intent(this, One.class);
    startActivity(manIntent);
   }
   else{
    mBillingService.requestPurchase("itemone", Consts.ITEM_TYPE_INAPP, null);
    break;
   }
  case R.id.imagebutton2:
   if(check[1] == true){
    Intent manIntent = new Intent(getApplicationContext(), Two.class);
    startActivity(manIntent);
   }
   else if(check[1] == false){
    mBillingService.requestPurchase("itemtwo", Consts.ITEM_TYPE_INAPP, null);
    break;
   }

 

 

이와 같이 앱을 구현했는데요..

빨간색 부분에서요..제가 check[0]에 true를 줘서 실행하면 그 안의 코드를 수행 하는건 성공했습니다.  

 

문제는요..

파란색 부분과 같이 case 문에 조건을 하나 더 추가 시키잖아요..그럼 이론상 빨간 부분이 실행 되어야 하는데 주황색 부분으로 넘어갔다가

백버튼을 눌러야 빨간색 부분을 실행 하더라구요 ㅡㅡ;;

 

 이거 왜 그런지 혹시 아시나요?? ㅠ 좀 도와주세요 3일째 입니다...ㅜ

RequestPurchaseResponse 는 아래와 같이 구현했거든요..

고수님들 부디 도와주세요...ㅠ

 

 @Override
 public void onRequestPurchaseResponse(RequestPurchase request, ResponseCode responseCode) {
  if(responseCode == ResponseCode.RESULT_OK) {
   if ( request.mProductId.equals("itemone") ){
    check[0] = true;
    Toast.makeText(activity, "좆같아 들어왔어!!"+ check[0], Toast.LENGTH_SHORT).show();
   }
   if ( request.mProductId.equals("itemtwo") ){
    check[1] = true;
   }
   if ( request.mProductId.equals("itemthree") ) {
    check[2] = true;
   }

  } else if(responseCode == ResponseCode.RESULT_USER_CANCELED) {
   Log.d("pay", "onRequestPurchaseResponse.ResponeCode.RESULT_USER_CANCELED");
  } else {
   Log.d("pay", "onRequestPurchaseResponse. else");
  }
 }