Commit 18dcc571 authored by k's avatar k

通知不发出声音

parent b42ff39e
......@@ -155,8 +155,8 @@ class DeckManagerActivityImpl extends BaseCardsAcitivity implements RecyclerView
return new DeckInfo();
}
mYdkFile = file;
if (mCardLoader.isOpen() && file.exists()) {
return mDeckAdapater.read(mCardLoader, file, mLimitList);
if (mCardLoader.isOpen() && mYdkFile.exists()) {
return mDeckAdapater.read(mCardLoader, mYdkFile, mLimitList);
} else {
return new DeckInfo();
}
......
......@@ -207,13 +207,16 @@ public class ServiceDuelAssistant extends Service {
remoteViews.setOnClickPendingIntent(R.id.buttonStopService, pendingIntent);
NotificationChannel channel = new NotificationChannel(CHANNEL_ID, CHANNEL_NAME,
NotificationManager.IMPORTANCE_HIGH);
NotificationManager.IMPORTANCE_DEFAULT);
channel.setSound(null, null);
channel.enableLights(false);
NotificationManager manager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
manager.createNotificationChannel(channel);
Notification.Builder builder = new Notification.Builder(this, CHANNEL_ID);
builder.setSmallIcon(R.drawable.ic_icon);
builder.setSound(null);
builder.setCustomContentView(remoteViews);
startForeground(1, builder.build());
}else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment