Asked  12 Months ago    Answers:  5   Viewed   21 times

does anyone know if there is a way to group a notification in the status bar but not in the list of notifications?

i want to show only one icon in the status bar but when the user drags down the "notifications list" it should be several notifications with different intents.

as i understood there is only possible to either group both notifications on both places or to create several notifications which will cause several notifications in the status bar. is this the case?

 Answers

5

as i undestood there is only possible to either group both notifications on both places or to create several notifications which will cause several notifications in the status bar. is this the case?

yes, but you can create as complex of a custom notification view as you want, via the contentview field on notification. this is a remoteviews, better known as the what you use for rendering a home screen app widget. so, while there can only be one entry in the notification drawer for you, you can have it have several buttons each firing a separate pendingintent.

Friday, August 13, 2021
 
c0m4
 
2

use alarm manager and put your notification in notifyservice class

intent myintent = new intent(current.this , notifyservice.class);     
alarmmanager alarmmanager = (alarmmanager)getsystemservice(alarm_service);
pendingintent = pendingintent.getservice(thisapp.this, 0, myintent, 0);
calendar calendar = calendar.getinstance();
calendar.set(calendar.hour_of_day, 12);
calendar.set(calendar.minute, 00);
calendar.set(calendar.second, 00);
alarmmanager.setrepeating(alarmmanager.rtc_wakeup, calendar.gettimeinmillis(), alarmmanager.interval_day , pendingintent);  //set repeating every 24 hours
Wednesday, June 30, 2021
 
Gilko
 
5

i solved it by setting screenorientation to "behind" in manifest file:

        android:screenorientation="behind"
Sunday, October 3, 2021
 
1

do you know any link of apk that i can test, if after download, installation process starts automatically

i am not aware that this is possible.

is any workaround that i can call install intent from code?

you can download the file yourself, then do an action_view intent on the local apk file. that, afaik, will immediately bring up the installation screen.

Tuesday, October 26, 2021
 
5

implement your notification like

     notification noti = new notificationcompat.builder(context)
                    .setsmallicon(icon_small)
                    .setticker(message)
                    .setlargeicon(largeicon)
                    .setwhen(system.currenttimemillis())
                    .setcontenttitle(title)
                    .setcontenttext(message)
                    .setcontentintent(contentintent)
                    //at most three action buttons can be added
                    .setautocancel(true).build();

and add support library v4 into your project and also import

import android.support.v4.app.notificationcompat;

notificationcompat helper for accessing features in notification introduced after api level 4 in a backwards compatible fashion.

for more information go to:http://developer.android.com/guide/topics/ui/notifiers/notifications.html

Tuesday, November 16, 2021
 
Only authorized users can answer the question. Please sign in first, or register a free account.
Not the answer you're looking for? Browse other questions tagged :