[ 
https://issues.apache.org/jira/browse/CB-12561?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Kerri Shotts closed CB-12561.
-----------------------------
    Resolution: Invalid

I suggest that this is not the best place for a question like this, ATM. This 
seems like it would be better asked on either the Cordova Google Group 
(https://groups.google.com/forum/#!forum/phonegap), the Cordova Slack 
(http://slack.cordova.io/), or the Adobe PhoneGap forums 
(http://forums.adobe.com/community/phonegap), or Stack Overflow 
(http://stackoverflow.com/tags/cordova). 

I'm closing this for now. If those forums determine that there is a bug or an 
improvement that needs to be made to Cordova, then the issue can be reopened.

> Incorrect service foreground notification generated
> ---------------------------------------------------
>
>                 Key: CB-12561
>                 URL: https://issues.apache.org/jira/browse/CB-12561
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android
>    Affects Versions: 3.5.0
>         Environment: Android M(v23)
>            Reporter: Ijas Ahamed N
>
> I have a service in my android application and i dont want android to kill 
> the service due to memory shortage. So i am running my service with 
> foreground notification.
> Here is my code for foreground service
> @Override
> public int onStartCommand(Intent intent, int flags, int startId) {
>     context = this.getApplicationContext();
>     notifyService();
>     return START_NOT_STICKY;
> }
> private void notifyService() {
>     String package_name = this.getApplication().getPackageName();
>     Intent notificationIntent = new Intent(this, MainActivity.class);
>     PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, 
> notificationIntent, 0);
>     Bitmap icon = BitmapFactory.decodeResource(getResources(),
>             this.getApplication().getResources().getIdentifier("icon", 
> "drawable-hdpi", package_name));
>     Notification notification = new NotificationCompat.Builder(this)
>             .setContentTitle("Smart Home")
>             .setContentText("Smart Home running in background")
> .setSmallIcon(this.getApplication().getResources().getIdentifier("icon", 
> "drawable-hdpi", package_name))
>             .setContentIntent(pendingIntent)
>             .setOngoing(true)
>             .build();
>     startForeground(notificationId, notification);
> } 
> Here is the output i get https://i.stack.imgur.com/DbfGe.jpg
> Notification is generated but notification title is not as i set. Also, when 
> i click this notification, it's moving to app info activity. But i want to 
> move to my main activity.
> Is there any problem with my code or cordova is replacing foreground 
> notification with other notification.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to