Groups
Groups
Sign in
Groups
Groups
日本Androidの会
Conversations
About
Send feedback
Help
画像削除後のサムネイル表示について
813 views
Skip to first unread message
KEN
unread,
Aug 24, 2011, 6:43:37 AM
8/24/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to 日本Androidの会
お世話になってます。安部です。
現在、ギャラリーと似たような写真管理のアプリを作成しており、
サムネイル一覧の表示を行っているのですが、実際の写真とサムネイルが異なる現象が出ています。
手順としては
1.アプリから画像を削除
2.アプリからカメラを起動して撮影
3.サムネイル一覧を表示
3の時に削除されたはずのサムネイルが2のサムネイルとして表示されます。
削除の方法ですが、
getContentResolver().delete(MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
MediaStore.Images.Media.DATA + "= ?", new String[]{path});
で削除しています。
サムネイルの取得は
MediaStore.Images.Thumbnails.getThumbnail(mCr, id,
MediaStore.Images.Thumbnails.MICRO_KIND, null);
で取得しています。
現象を確認した機種ですが、
・GALAPAGOS 003SH (SoftBank)
・AQUOS PHONE SH-12C (docomo)
それ以外の機種はほぼ問題ありません。
何かお分かりの方がいらっしゃいましたら、ご教授して頂けないでしょうか?
よろしくお願いいたします。
fuku
unread,
Aug 24, 2011, 8:04:45 AM
8/24/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to 日本Androidの会
鹿児島支部 福吉です。
サムネイルの取得の前にメディアスキャンを実行してみたらどうでしょうか?
sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED,
Uri.parse("file://" + Environment.getExternalStorageDirectory())));
KEN
unread,
Aug 24, 2011, 8:46:21 PM
8/24/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to 日本Androidの会
福吉様
ご回答ありがとうございます。
やってみたのですが結果変わらずでした。
サムネイルがおかしくなった後にギャラリーを起動して、
再度アプリのほうでサムネイルを見ると正しく表示されていたので
ギャラリーのソースを確認してみようと思います。
KEN
unread,
Aug 25, 2011, 7:19:54 AM
8/25/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to 日本Androidの会
福吉様
提案された方法ですが、
メディアスキャンに時間がかかっておりサムネイル表示前だとダメみたいでした。
カメラ撮影後にメディアスキャンして、少し時間をおくことで正常にサムネイルが表示されました。
現在の問題としてはカメラ撮影後すぐにサムネイルを表示すると
スキャンが終わってなくサムネイルがおかしくなります。
スキャンが早めに完了できればOKかと思っています。
ギャラリーのソースは私には難しすぎました・・・
fuku
unread,
Aug 25, 2011, 8:17:46 PM
8/25/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to 日本Androidの会
福吉です。
アプリから画像を削除したタイミングでメディアスキャンしたらどうでしょうか?
それならカメラ撮影したりするまでに反映されるのではないでしょうか。
私もサムネイル表示を使用したアプリを作成したときに本体の画像は削除されても
サムネイル画像が削除されないことがありましたので。
KEN
unread,
Aug 26, 2011, 3:26:54 AM
8/26/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to 日本Androidの会
福吉様
削除後にメディアスキャンではダメでした。
やはりカメラ撮影後にメディアスキャンしないと反映されないみたいです。
サムネイルの更新が若干遅れますが、ユーザーには了解を得たのでこの方法でいこうと思います。
ありがとうございました。
Reply all
Reply to author
Forward
0 new messages