簡體   English   中英

通過Android共享時,Google +應用顯示錯誤圖片

[英]Google+ app showing wrong pictures when sharing through Android

我已通過編程方式將Google+共享添加到了我的應用中。 我的帖子中包含一組照片,並與以下代碼共享:

private void shareToGooglePlus() {
  // Launch the Google+ share dialog with attribution to your app.
  PlusShare.Builder share = new PlusShare.Builder(this);

  for (String imageFilename : imageList) {
    Uri imageUri = Uri.fromFile(new File(imageFilename));
    share.addStream(imageUri);
  }

  share.setText("My images");
  share.setType("image/jpeg");

  startActivityForResult(share.getIntent(), 0);
}

執行此代碼后,手機上的Google+應用將啟動,並且預覽顯示的圖片和文字符合預期。

但是,如果我多次運行此圖像,並在以后的運行中包含不同的圖像,則原始圖像將顯示在Google+帖子預覽中,而不是新圖像。 如果我提交該帖子,則正確的圖像會顯示在該帖子中-新的而不是原始的。

我認為Google+應用程序具有某種緩存機制。 是否可以通過編程方式清除該緩存,以便在Google+應用發布后預覽中顯示正確的圖像?

提前感謝。

嘗試在每次運行時為源文件分配不同的隨機名稱(通過重命名或復制)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM