Android 通知图标未加载可绘制区域设置
我创建了一个简单的Android应用程序()来通知文本,它有两个按钮,一个加载默认语言环境文本和图标,另一个加载“fa”语言环境。图像、通知标题和通知文本都与区域设置有关,但通知图标来自默认区域设置(“en”)Android 通知图标未加载可绘制区域设置,android,android-notifications,android-ui,android-location,android-notification-bar,Android,Android Notifications,Android Ui,Android Location,Android Notification Bar,我创建了一个简单的Android应用程序()来通知文本,它有两个按钮,一个加载默认语言环境文本和图标,另一个加载“fa”语言环境。图像、通知标题和通知文本都与区域设置有关,但通知图标来自默认区域设置(“en”) 您可以使用用户区域设置和android区域设置文件夹吗? Button en = (Button) findViewById(R.id.buttonEN); en.setOnClickListener(new View.OnClickListener() {
您可以使用用户区域设置和android区域设置文件夹吗?
Button en = (Button) findViewById(R.id.buttonEN);
en.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
conf.locale = new Locale("en");
res.updateConfiguration(conf, dm);
NotificationCompat.Builder overdueNotification = new NotificationCompat.Builder(getApplicationContext())
.setContentText(getText(R.string.notification_service_content_text))
.setSmallIcon(R.drawable.ic_stat);
overdueNotification.setContentTitle(getText(R.string.notification_service_content_title));
notificationManager.notify(1, overdueNotification.build());
image.setImageResource(R.drawable.ic_stat);
image.setImageResource(R.drawable.ic_launcher);
}
});
Button fa = (Button) findViewById(R.id.buttonFA);
fa.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
conf.locale = new Locale("fa");
res.updateConfiguration(conf, dm);
NotificationCompat.Builder overdueNotification = new NotificationCompat.Builder(getApplicationContext())
.setContentText(getText(R.string.notification_service_content_text))
.setSmallIcon(R.drawable.ic_stat);
overdueNotification.setContentTitle(getText(R.string.notification_service_content_title));
notificationManager.notify(2, overdueNotification.build());
image.setImageResource(R.drawable.ic_stat);
image.setImageResource(R.drawable.ic_launcher);
}
});