I'm trying to add a Typeface in my NotificationCompat.Builder ->setContentTitle() and setContentText(). I initialized Typeface by
Typeface banglaFont = Typeface.createFromAsset(this.getAssets(), "kalpurush.ttf");
in IntentService. To create Notification i used following code.
NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(
this)
.setLargeIcon(bitmap)
.setSmallIcon(R.drawable.ic_launcher)
.setContentTitle(userName)
.setAutoCancel(true)
// .setStyle(
// new NotificationCompat.BigTextStyle().bigText(msg))
.setStyle(new NotificationCompat.InboxStyle())
.setVibrate(pattern).setLights(Color.BLUE, 500, 500)
.setSound(alarmSound).setContentText(msg);
mBuilder.setContentIntent(contentIntent);
Notification n = mBuilder.build();
int min = 1001;
int max = 2000;
Random r = new Random();
int randomNumber = r.nextInt(max - min + 1) + min;
int notID = randomNumber;
mNotificationManager.notify(notID, n);
But i cann't understand how can i set the Typeface in my Notification title and content. Any suggestions or reference would be highly appreciated.
Thanks in advance.
this is very useful answer, done by creating own typefacespan http://www.codeproject.com/Questions/567126/AndroidplusNotificationplusinplusotherpluslanguage
custom_notification.xml
code for android to notification method
call this method like this:
i hope this is very helpful