1.在资源中插入图片插入
2.实现如下代码
public class MainActivity extends AppCompatActivity {
TextView tx;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
tx = (TextView)findViewById(R.id.textView2);
tx.setText("你好呀");
tx.setTextColor(Color.RED);
ImageSpan span = new ImageSpan(this, R.mipmap.xiaogou);
SpannableString spanStr = new SpannableString("我是小狗 ");
spanStr.setSpan(span, spanStr.length()-1, spanStr.length(), Spannable.SPAN_INCLUSIVE_EXCLUSIVE);
tx.setText(spanStr);
}
}
改变APK图标只需将下图的文件修改即可