Groups
Groups
Sign in
Groups
Groups
日本Androidの会
Conversations
About
Send feedback
Help
EditTextでImageSpanをコピペすると文字化けする件
267 views
Skip to first unread message
leegun
unread,
Jan 21, 2011, 7:30:03 AM
1/21/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の会
いつもお世話になっております。
EditTextを使用してエディタを開発しているのですが、表題の件で悩んでます。
EditText長押しで出てくるコピペ機能で
AbsoluteSizeSpanやForegroundColorSpanなどは正常にコピペできましたが、
ImageSpanされた文字列をコピペすると文字が化けてしまいます。
ソースをたどるとEditTextはTextViewを継承していてTextViewの内部でClipboardManagerにset,getしてい
るようでしたので
自クラス内で試したところ同じく文字化けしました。
ImageSpanを文字化けさせずにコピペするにはどうすればよろしいでしょうか?
申し訳ありませんが、ご教授のほど宜しくお願いします。
leegun
unread,
Jan 24, 2011, 9:19:47 PM
1/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の会
少し分かったのですが、CUTだと文字化けせずCOPYだと文字化け(OBJという文字列が入った四角)することが分かりました。
自前でコピペ機能を実装しようと思って
Spannable変数に一時保存して、
EditText#SetText(Spannable);
してます。
恐らくEditTextに同じImageSpanがあると文字化けするようです。
leegun
unread,
Jan 25, 2011, 7:02:39 AM
1/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の会
結局、独自実装しました。
わざわざImageSpanのindexを一文字削除して再setSpanを行いました。
Reply all
Reply to author
Forward
0 new messages