我在这里需要帮助。下面的代码是完美的,但我想在从Android应用程序到Facebook共享屏幕截图时添加一些消息和URL。 目前,下面的代码只会截取屏幕截图并分享,但我希望与网址和/或消息共享。
//share button
btn_share = new Instance(new Sprite(this.getResources().getString(R.string.Share), (int) this.getResources().getDimension(R.dimen.share), secondaryFont, this.getResources().getColor(R.color.color_share_btn)), 0, 0, this, false);
btn_share.y = ScreenHeight() / 2 + ScreenWidth() / 4 + btn_share.getHeight() / 2;
btn_share.x = ScreenWidth() / 2 - btn_share.getWidth() / 2;
//share screenshot
btn_share.unHighlight();
if (btn_share.isTouched(event)) {
share();
if (sound_button != 0 && !sound_muted)
sp.play(sound_button, 1, 1, 0, 0, 1);
}
//share screenshot
public void share() {
//share
Share sharer = new Share();
screenshot = Bitmap.createBitmap(ScreenWidth(), ScreenHeight(), Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas();
canvas.setBitmap(screenshot);
int temp_state = state;
state = GAMEPLAY;
Draw(canvas);
state = temp_state;
sharer.share_screenshot(this, screenshot);
}`
`