title: Android Cannot resolve method startIntentSenderForResult()
body: <p>i try to follow the tutorial from this page <a href="http://developer.android.com/google/play/billing/billing_integrate.html" rel="nofollow">http://developer.android.com/google/play/billing/billing_integrate.html</a></p>
  
  <p>but i have a little problem when i try to use the method startIntentSenderForResult() and i don't understand why, it says that he cannot resolve the method.</p>
  
  <p>I'll paste my code because maybe you can tell me what's going on but before i'll give you a little bit of explanation:</p>
  
  <p>I have 2 buttons in my StoreActivity which i implement with the information from google market with the method queryInventory() and after when i click on these buttons i launch the method buyThings() from my file BillingServiceConnection.</p>
  
  <p>Here are the files:</p>
  
  <h2>StoreActivity</h2>
  
  <pre><code>public class StoreActivity extends Activity  implements BillingQuery{
  
      private static final Logger logger = Logger.getLogger("StoreActivity");
      private BillingServiceConnection billingServiceConnection = new BillingServiceConnection(this);
      private Button storeButton;
      private Button storeButton2;
      ArrayList&lt;StoreItem&gt; items = new ArrayList&lt;&gt;();
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_store);
          configureBilling();
      }
  
      private void configureBilling() {
          Intent serviceIntent = new Intent("com.android.vending.billing.InAppBillingService.BIND");
          serviceIntent.setPackage("com.android.vending");
          bindService(serviceIntent, billingServiceConnection, Context.BIND_AUTO_CREATE);
      }
  
      @Override
      protected void onDestroy() {
          super.onDestroy();
          if (billingServiceConnection != null) {
              unbindService(billingServiceConnection);
          }
      }
  
      @Override
      public void onBillingQuerySuccess(ArrayList&lt;StoreItem&gt; storeItems) {
          items = storeItems;
          storeButton = (Button) findViewById(R.id.activity_menu_store_button);
          storeButton.setText(storeItems.get(0).getName() + " = " + storeItems.get(0).getPrice());
  
          storeButton2 = (Button) findViewById(R.id.activity_menu_store_button_2);
          storeButton2.setText(storeItems.get(1).getName() + " = " + storeItems.get(1).getPrice());
      }
  
      public void storeButton(View view) {
          billingServiceConnection.buyJocker(items.get(0).getProductId());
      }
      public void storeButton2(View view) {
          billingServiceConnection.buyJocker(items.get(1).getProductId());
      }
  </code></pre>
  
  <h2>BillingServiceConnection</h2>
  
  <pre><code>public class BillingServiceConnection implements ServiceConnection {
  
      private static final Logger logger = Logger.getLogger("BillingServiceConnection");
      private static final String SKU_PACK_SMALL = "small_piece_pack";
      private static final String SKU_PACK_MEDIUM = "medium_piece_pack";
      private IInAppBillingService billingService = null;
      private BillingQuery queryCallback;
  
      public BillingServiceConnection(BillingQuery queryCallback) {
          this.queryCallback = queryCallback;
      }
  
      @Override
      public void onServiceConnected(ComponentName componentName, IBinder iBinder) {
          billingService = IInAppBillingService.Stub.asInterface(iBinder);
          queryInventory();
      }
  
      @Override
      public void onServiceDisconnected(ComponentName componentName) {
          billingService = null;
      }
  
      public void buyThings(String productId){
          Bundle buyIntentBundle = null;
          try {
              buyIntentBundle = billingService.getBuyIntent(3, "fr.xxx.xxx", productId, "inapp", "bGoa+V7g/yqDXvKRqq+JTFn4uQZbPiQJo4pf9RzJ");
          } catch (RemoteException e) {
              e.printStackTrace();
          }
          PendingIntent pendingIntent = buyIntentBundle.getParcelable("BUY_INTENT");
          startIntentSenderForResult(pendingIntent.getIntentSender(),1001, new Intent(), Integer.valueOf(0), Integer.valueOf(0),Integer.valueOf(0));
      }
  
      protected void onActivityResult(int requestCode, int resultCode, Intent data) {
          if (requestCode == 1001) {
              int responseCode = data.getIntExtra("RESPONSE_CODE", 0);
              String purchaseData = data.getStringExtra("INAPP_PURCHASE_DATA");
              String dataSignature = data.getStringExtra("INAPP_DATA_SIGNATURE");
  
              if (resultCode == RESULT_OK) {
                  try {
                      JSONObject jo = new JSONObject(purchaseData);
                      String sku = jo.getString("productId");
                      alert("You have bought the " + sku + ". Excellent choice, adventurer!");
                  }
                  catch (JSONException e) {
                      alert("Failed to parse purchase data.");
                      e.printStackTrace();
                  }
              }
          }
      }
  
      public void queryInventory() {
          ArrayList&lt;StoreItem&gt; items = new ArrayList&lt;&gt;();
  
          ArrayList&lt;String&gt; skuList = new ArrayList&lt;String&gt;();
          skuList.add(SKU_PACK_SMALL);
          skuList.add(SKU_PACK_MEDIUM);
  
          Bundle querySkus = new Bundle();
          querySkus.putStringArrayList("ITEM_ID_LIST", skuList);
  
          try {
              Bundle skuDetails = billingService.getSkuDetails(3, "fr.xxx.xxx", "inapp", querySkus);
  
              int response = skuDetails.getInt("RESPONSE_CODE");
              if (response != 0) {
                  logger.warning("Bad server response code");
                  return;
              }
              else if (response == 0) {
                  ArrayList&lt;String&gt; responseList = skuDetails.getStringArrayList("DETAILS_LIST");
  
                  logger.info("Details list size : " + responseList.size());
  
                  for (String thisResponse : responseList) {
                      JSONObject object = new JSONObject(thisResponse);
                      String sku = object.getString("productId");
                      String price = object.getString("price");
                      if (sku.equals(SKU_PACK_SMALL)){
                          items.add(new StoreItem("10", price, sku));
                      }
                      else if (sku.equals(SKU_PACK_MEDIUM)){
                          items.add(new StoreItem("60", price, sku));
                  }
                  }
              }
  
              logger.info("Server response " + skuDetails.toString());
          } catch (RemoteException | JSONException ex) {
              logger.warning(ex.toString());
          }
  
          queryCallback.onBillingQuerySuccess(items);
      }
  </code></pre>
  
  <p>If someone can help me i will be really grateful.
  Thanks.</p>