Code example for Intent

Methods: getBroadcastputExtrasetActionsetData

-1
	 * @param buttonCode 
	 * @param widgetId 
	 */ 
	public static void setupWidgetButton(RemoteViews remoteView, int viewId, Context context, Object caller,  String buttonCode, int widgetId, String uri, String action){
	 
        Intent active = new Intent(context, caller.getClass());
        active.setAction(action);
        active.putExtra(COMMAND, buttonCode);
         
        // Make this pending intent unique to prevent updating other intents 
        Uri data = Uri.withAppendedPath(Uri.parse(uri + "://widget/id/#"+buttonCode), String.valueOf(widgetId));	
		active.setData(data);
        remoteView.setOnClickPendingIntent(viewId, PendingIntent.getBroadcast(context, 0, active, PendingIntent.FLAG_UPDATE_CURRENT));
	} 
	 
} 
Stop searching for code, let great code find you!  Add Codota to your java IDE