我开发了Android app,它会在特定时间发送通知。通知效果很好,它可以很好地显示阿拉伯语和英语文本。但是当我在Android设备Nexus 5上使用Android版本5.1.1运行应用程序时,阿拉伯语中的文本通知显示为照片
这是我使用的代码..
android.app.Notification notification = new android.app.Notification(R.drawable.ic_launcher,ticker, System.currentTimeMillis());
notification.setLatestEventInfo(activity, title, text, pendingIntent);
// Cancel the notification after its selected
notificationIntent.setAction(Long.toString(System.currentTimeMillis()));
// notificationIntent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP);
notificationIntent.addFlags(Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT | Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
notification.flags |= android.app.Notification.FLAG_AUTO_CANCEL;
notification.defaults |= android.app.Notification.DEFAULT_SOUND;
notification.defaults |= android.app.Notification.DEFAULT_VIBRATE;
NotificationManager notificationManager = (NotificationManager)activity.getSystemService(activity.NOTIFICATION_SERVICE);
notificationManager.notify(Id++, notification);
答案 0 :(得分:0)
尝试使用Arabic Reshaper 我以前用它来展示法律API中的阿拉伯语 https://github.com/agawish/Better-Arabic-Reshaper/blob/master/src/org/amr/arabic/ArabicReshaper.java