Code example for Intent

Methods: putExtrasetClass

0
		context.startService(intent);
	} 
 
	private static Intent createIntent(Context context, Action action) {
		final String actionString = getActionForIntent(context, action);
		final Intent intent = new Intent(actionString);
		intent.setClass(context, BillingService.class);
		return intent;
	} 
 
	private static final String getActionForIntent(Context context, Action action) {
		return context.getPackageName() + "." + action.toString();
	} 
 
	public static void getPurchaseInformation(Context context, String[] notifyIds, long nonce) {
		final Intent intent = createIntent(context, Action.GET_PURCHASE_INFORMATION);
		intent.putExtra(EXTRA_NOTIFY_IDS, notifyIds);
		intent.putExtra(EXTRA_NONCE, nonce);
		context.startService(intent);
	} 
 
	public static void requestPurchase(Context context, String itemId, String developerPayload) {
		final Intent intent = createIntent(context, Action.REQUEST_PURCHASE);
		intent.putExtra(EXTRA_ITEM_ID, itemId);
		intent.putExtra(EXTRA_DEVELOPER_PAYLOAD, developerPayload);
		context.startService(intent);
	} 
	 
	public static void requestSubscription(Context context, String itemId, String developerPayload) {
		final Intent intent = createIntent(context, Action.REQUEST_SUBSCRIPTION);
Stop searching for code, let great code find you!  Add Codota to your java IDE