HelloWorld
Newbie
The following represents a code that I added to softkeyboard class (from Android SDK samples) the purpose of it is to print an image stored in the resouse
i Called it using the follwing sentence:
The result after excuting is writing abcde without the image
when i create a textView in another activity ...
and call the function tv.setText("addSmileySpans("abcde"),1")
it works correctly and display the image
is the problem with commitText ???? (note : i should use commitText in softkeyboard)
Code:
public CharSequence addSmileySpans(CharSequence text) {
Drawable bm = getResources().getDrawable(R.drawable.myimage);
bm.setBounds(0, 0, bm.getIntrinsicWidth(), bm.getIntrinsicHeight());
SpannableStringBuilder builder = new SpannableStringBuilder(text);
ImageSpan is = new ImageSpan(bm);
builder.setSpan(is,1,3,Spannable.SPAN_INCLUSIVE_EXCLUSIVE);
return builder;
}
i Called it using the follwing sentence:
Code:
getCurrentInputConnection().commitText(addSmileySpans("abcde"),1);
when i create a textView in another activity ...
and call the function tv.setText("addSmileySpans("abcde"),1")
it works correctly and display the image
is the problem with commitText ???? (note : i should use commitText in softkeyboard)

...