Java tutorial
//package com.java2s; import android.content.Context; import android.content.Intent; public class Main { private static final String ACTION_SET_API_CREDENTIAL = "me.zhanghai.android.douya.intent.action.SET_API_CREDENTIAL"; private static final String EXTRA_API_KEY = "me.zhanghai.android.douya.intent.extra.API_KEY"; private static final String EXTRA_API_SECRET = "me.zhanghai.android.douya.intent.extra.API_SECRET"; public static void setApiKeyAndSecret(String apiKey, String apiSecret, Context context) { Intent intent = new Intent(ACTION_SET_API_CREDENTIAL).putExtra(EXTRA_API_KEY, apiKey) .putExtra(EXTRA_API_SECRET, apiSecret); context.sendBroadcast(intent); } }