IWXAPI api = WXAPIFactory.createWXAPI(context, APP_ID, false); api.registerApp(APP_ID); WXWebpageObject webpage = new WXWebpageObject(); webpage.webpageUrl = "http://www.xxxx.com/wap/showShare/; WXMediaMessage msg = new WXMediaMessage(webpage); msg.title = "我要约"; msg.description = "我要约分享"; try { Bitmap bmp = BitmapFactory.decodeResource(getResources(), R.drawable.send_img); Bitmap thumbBmp = Bitmap.createScaledBitmap(bmp, 150, 150, true); bmp.recycle(); msg.setThumbImage(thumbBmp); } catch (Exception e) { e.printStackTrace(); } SendMessageToWX.Req req = new SendMessageToWX.Req(); req.transaction = String.valueOf(System.currentTimeMillis()); req.message = msg; req.scene = SendMessageToWX.Req.WXSceneTimeline; api.sendReq(req);