1
Notification.Builderにテキストを表示したい。 私の言語は右から左に書かれています。 それでは、どのようにNotification.Builderのテキストとタイトルの方向を変更できますか? 右から左Notificatoin.Builder
私のコード:その後、
NotificationCompat.BigTextStyle bigTextStyle = new
NotificationCompat.BigTextStyle();
bigTextStyle.setBigContentTitle(getString(R.string.smartservice));
bigTextStyle.bigText(getString(R.string.aboutsmartservice));
Uri path =
RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
Bitmap icon = BitmapFactory.decodeResource(getResources(),
R.drawable.ic3);
NotificationCompat.Builder mBuilder = new
NotificationCompat.Builder(this);
mBuilder.setTicker(getResources().getString(R.string.smartservice))
.setContentTitle(getResources().getString(R.string.smartservice))
.setContentText(getResources().getString(R.string.aboutsmartservice))
.setSmallIcon(R.drawable.ic4)
.setLargeIcon(Bitmap.createScaledBitmap(icon, 64, 64,false))
.setStyle(bigTextStyle)
.setSound(path)
.setPriority(Notification.PRIORITY_MAX);
Intent stopreciver = new Intent();
stopreciver.setAction("STOP_ACTION");
PendingIntent pendingIntentYes2 =
PendingIntent.getBroadcast(this, 12345, stopreciver,
PendingIntent.FLAG_UPDATE_CURRENT);
mBuilder.addAction(R.drawable.ic_remove_circle_outline_white_18dp,
getResources().getString(R.string.stopservice), pendingIntentYes2);
startForeground(101, mBuilder.build());
私は同じ問題を抱えている、あなたは解決策を見つけましたか? –