i'm tring to implement In App Billing into my application. I wrote this code.
public class Settings extends PreferenceFragment {
    ServiceConnection mServiceConn;
    IInAppBillingService mService;
    PendingIntent pending;
    Intent intent;
    Bundle bundle;
    @Override
    public void onDestroy() {
        super.onDestroy();
        if (mService != null) {
            getActivity().unbindService(mServiceConn);
        }   
    }
    @Override
    public void onCreate(Bundle savedIstanceState) {
        super.onCreate(savedIstanceState);
        addPreferencesFromResource(R.xml.settings);
        getActivity().getActionBar().setTitle(getString(R.string.settings));
         mServiceConn = new ServiceConnection() {
                @Override
                public void onServiceConnected(ComponentName arg0, IBinder arg1) {
                    // TODO Auto-generated method stub
                       mService = IInAppBillingService.Stub.asInterface(arg1);
                }
                @Override
                public void onServiceDisconnected(ComponentName arg0) {
                    // TODO Auto-generated method stub
                    mService = null;
                }
            };
            intent = new Intent("com.android.vending.billing.InAppBillingService.BIND").setPackage("com.android.vending");
            getActivity().bindService(intent, mServiceConn, Context.BIND_AUTO_CREATE);
            try {
                bundle = mService.getBuyIntent(3, getActivity().getPackageName(), "pro_version", "inapp", "bGoa+V7g/yqDXvKRqq+JTFn4uQZbPiQJo4pf9RzJ");
                pending = bundle.getParcelable("BUY_INTENT");
                getActivity().startIntentSenderForResult(pending.getIntentSender(), 1001, new Intent(), Integer.valueOf(0), Integer.valueOf(0), Integer.valueOf(0));
            } catch (RemoteException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            } catch (SendIntentException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
    }
}
When i launch the application and open this Fragment the app crash with this error:
01-31 19:59:30.969: E/AndroidRuntime(11546): java.lang.NullPointerException: Attempt to invoke interface method 'android.os.Bundle com.android.vending.billing.IInAppBillingService.getBuyIntent(int, java.lang.String, java.lang.String, java.lang.String, java.lang.String)' on a null object reference
In the AndroidManifest obviously i've these permissions:
 <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>     
 <uses-permission android:name="android.permission.INTERNET"/> 
 <uses-permission android:name="com.android.vending.BILLING"/>
 
    