-
Notifications
You must be signed in to change notification settings - Fork 255
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Player notification stays active but unresponsive when app is closed #79
Comments
@gwitteveen, the solution @samyachour proposes in #49 fixes the problem. |
not working #49 |
Hi @MichaelPintos, did you add the created service to your app's AndroidManifest.xml?
Don't forget to import Intent and Bundle into your MainActivity.java:
In all cases replace com.example with com.whateverYourApp This worked for me. You can see a working example I uploaded to the play store a few days ago here: https://play.google.com/store/apps/details?id=com.am750&hl=en |
Hi, thx for help #80 work fine
… El 28 abr. 2017, a las 14:46, Jero ***@***.***> escribió:
Hi @MichaelPintos <https://github.com/MichaelPintos>, did you add the created service to your app's AndroidManifest.xml?
Create new Service (I called it OnTaskRemovedService). I created a new file with the following content:
package com.example;
import android.app.Service;
import android.os.IBinder;
import android.app.NotificationManager;
import android.content.Context;
import android.content.Intent;
public class OnTaskRemovedService extends Service {
/** interface for clients that bind */
@OverRide
public IBinder onBind(Intent intent) {
return null;
}
@OverRide
public void onTaskRemoved(Intent rootIntent) {
super.onTaskRemoved(rootIntent);
NotificationManager nManager = ((NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE));
nManager.cancelAll();
}
}
Start service in MainActivity.java:
@OverRide
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
startService(new Intent(this, OnTaskRemovedService.class));
}
Don't forget to import Intent and Bundle into your MainActivity.java:
import android.content.Intent;
import android.os.Bundle;
Finally declare the service in the app's AndroidManifest.xml:
<service android:name="com.example.OnTaskRemovedService" android:stopWithTask="false" />
In all cases replace com.example with com.whateverYourApp
This worked for me. You can see a working example I uploaded to the app store a few days ago here: https://play.google.com/store/apps/details?id=com.am750&hl=en <https://play.google.com/store/apps/details?id=com.am750&hl=en>
The only issue I couldn't resolve for this app was #80 <#80> . For rest of the repo, it's a great work by @tlenclos <https://github.com/tlenclos>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#79 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AZpDPpj0qBSvhmUtfW-GKyzopcnvX1_Xks5r0iXvgaJpZM4MiMR5>.
|
The player notification stays in the notification screen when the app is closed, but becomes unresponsive as in the play button doesn't work and the close button doesn't work.
You would expect the notification to be removed when the app is closed or at least be able to dismiss the notification.
I thought it might due to the way I implemented react-native-audio-streaming, but I checked LaCaveWebradio from the Play store and there the issue seems to persist.
Tested on Android 7.0
The text was updated successfully, but these errors were encountered: