Android QuickContactBadge with letters like Android Lollipop
问题 I have a list of contacts and I want to show in each contact's QuickContactBadge the first letter of his name. Can I create the images in runtime? This is like Android Lollipop, where contacts and dialer uses QuickContactBadge with letters: 回答1: I use a function to generate these images. public static Bitmap generateCircleBitmap(Context context, int circleColor, float diameterDP, String text){ final int textColor = 0xffffffff; DisplayMetrics metrics = Resources.getSystem().getDisplayMetrics()