Я использую уведомления FCM в своем приложении и хочу открыть действие, называемое ManagesalesMainActivity, которое не является деятельностью пусковой установки и хочу пройти строку, используя ожидающие намерения. Строка через экраны Splash, но я не могу доставить строку в Splashcreen. Vibrator v = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
long[] pattern = {100, 300, 300, 300};
v.vibrate(pattern, -1);
NotificationCompat.Builder builder = new
NotificationCompat.Builder(this,"CHANNEL_ID");
Intent resultIntent = new Intent(this, ManageSalesMainActivity.class);
resultIntent.putExtra("order_status",message_status);
PendingIntent pendingIntent = PendingIntent.getActivity(this, 1,
resultIntent, PendingIntent.FLAG_IMMUTABLE);
builder.setContentTitle(Objects.requireNonNull(remoteMessage.getNotification())
.getTitle());
builder.setContentText(remoteMessage.getNotification().getBody());
builder.setContentIntent(pendingIntent);
builder.setStyle(new
NotificationCompat.BigTextStyle().bigText(remoteMessage.getNotification()
.getBody()));
builder.setAutoCancel(true);
builder.setSmallIcon(R.drawable.go_local_logo_without_bg);
builder.setVibrate(pattern);
builder.setPriority(Notification.PRIORITY_MAX);
mNotificationManager=NotificationManager)getApplicationContext()
.getSystemService(Context.NOTIFICATION_SERVICE);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
// string gannelid = "your_channel_id";
string channelid = "channel_id";
NotificationChannel channel = new NotificationChannel(
channelId,
"Channel human readable title",
NotificationManager.IMPORTANCE_HIGH);
channel.enableLights(true);
channel.enableVibration(true);
channel.setVibrationPattern(pattern);
channel.canBypassDnd();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
channel.canBubble();
}
mNotificationManager.createNotificationChannel(channel);
builder.setChannelId(channelId);
}
mNotificationManager.notify(1000, builder.build());
Подробнее здесь: https://stackoverflow.com/questions/795 ... e-click-on
Как открыть деятельность, отличную от активности запуска в Android, когда мы нажимаем на уведомление ⇐ Android
Форум для тех, кто программирует под Android
1744526691
Anonymous
Я использую уведомления FCM в своем приложении и хочу открыть действие, называемое ManagesalesMainActivity, которое не является деятельностью пусковой установки и хочу пройти строку, используя ожидающие намерения. Строка через экраны Splash, но я не могу доставить строку в Splashcreen. Vibrator v = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
long[] pattern = {100, 300, 300, 300};
v.vibrate(pattern, -1);
NotificationCompat.Builder builder = new
NotificationCompat.Builder(this,"CHANNEL_ID");
Intent resultIntent = new Intent(this, ManageSalesMainActivity.class);
resultIntent.putExtra("order_status",message_status);
PendingIntent pendingIntent = PendingIntent.getActivity(this, 1,
resultIntent, PendingIntent.FLAG_IMMUTABLE);
builder.setContentTitle(Objects.requireNonNull(remoteMessage.getNotification())
.getTitle());
builder.setContentText(remoteMessage.getNotification().getBody());
builder.setContentIntent(pendingIntent);
builder.setStyle(new
NotificationCompat.BigTextStyle().bigText(remoteMessage.getNotification()
.getBody()));
builder.setAutoCancel(true);
builder.setSmallIcon(R.drawable.go_local_logo_without_bg);
builder.setVibrate(pattern);
builder.setPriority(Notification.PRIORITY_MAX);
mNotificationManager=NotificationManager)getApplicationContext()
.getSystemService(Context.NOTIFICATION_SERVICE);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
// string gannelid = "your_channel_id";
string channelid = "channel_id";
NotificationChannel channel = new NotificationChannel(
channelId,
"Channel human readable title",
NotificationManager.IMPORTANCE_HIGH);
channel.enableLights(true);
channel.enableVibration(true);
channel.setVibrationPattern(pattern);
channel.canBypassDnd();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
channel.canBubble();
}
mNotificationManager.createNotificationChannel(channel);
builder.setChannelId(channelId);
}
mNotificationManager.notify(1000, builder.build());
Подробнее здесь: [url]https://stackoverflow.com/questions/79571270/how-to-open-an-activity-other-than-launcher-activity-in-android-when-we-click-on[/url]
Ответить
1 сообщение
• Страница 1 из 1
Перейти
- Кемерово-IT
- ↳ Javascript
- ↳ C#
- ↳ JAVA
- ↳ Elasticsearch aggregation
- ↳ Python
- ↳ Php
- ↳ Android
- ↳ Html
- ↳ Jquery
- ↳ C++
- ↳ IOS
- ↳ CSS
- ↳ Excel
- ↳ Linux
- ↳ Apache
- ↳ MySql
- Детский мир
- Для души
- ↳ Музыкальные инструменты даром
- ↳ Печатная продукция даром
- Внешняя красота и здоровье
- ↳ Одежда и обувь для взрослых даром
- ↳ Товары для здоровья
- ↳ Физкультура и спорт
- Техника - даром!
- ↳ Автомобилистам
- ↳ Компьютерная техника
- ↳ Плиты: газовые и электрические
- ↳ Холодильники
- ↳ Стиральные машины
- ↳ Телевизоры
- ↳ Телефоны, смартфоны, плашеты
- ↳ Швейные машинки
- ↳ Прочая электроника и техника
- ↳ Фототехника
- Ремонт и интерьер
- ↳ Стройматериалы, инструмент
- ↳ Мебель и предметы интерьера даром
- ↳ Cантехника
- Другие темы
- ↳ Разное даром
- ↳ Давай меняться!
- ↳ Отдам\возьму за копеечку
- ↳ Работа и подработка в Кемерове
- ↳ Давай с тобой поговорим...
Мобильная версия