package com.itap.voiceemoticon; import com.itap.voiceemoticon.third.WeixinHelper; import com.tencent.mm.sdk.openapi.IWXAPI; import com.tencent.mm.sdk.openapi.WXAPIFactory; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; public class AppRegister extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { System.out.println("AppRegister onReceive"); final IWXAPI api = WXAPIFactory.createWXAPI(context, null); // 将该app注册到微信 api.registerApp(WeixinHelper.APP_ID); } }