0
在我的應用程序中,我想在Twitter中點擊按鈕發佈照片。
所以我使用這麼多的代碼,但不工作。 所以我想要得到的代碼在Twitter中分享一個點擊一次點擊要將按鈕發送至android中的按鈕,點擊按鈕?
在我的應用程序中,我想在Twitter中點擊按鈕發佈照片。
所以我使用這麼多的代碼,但不工作。 所以我想要得到的代碼在Twitter中分享一個點擊一次點擊要將按鈕發送至android中的按鈕,點擊按鈕?
之前去問問題。嘗試谷歌或搜索SO的類似問題。
在這裏看到:see here
試試這個:
Intent targetedShare = new Intent(android.content.Intent.ACTION_SEND);
targetedShare.setType("image/jpeg"); // put here your mime type
targetedShare.putExtra(Intent.EXTRA_TEXT, "My body of post/email");
targetedShare.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(new File(imagePath)));
Intent chooserIntent = Intent.createChooser(targetedShare, "Select app to share");
chooserIntent.putExtra(Intent.EXTRA_INITIAL_INTENTS, targetedShare);
startActivity(chooserIntent);