Commit 18dcc571 authored by k's avatar k

通知不发出声音

parent b42ff39e
...@@ -155,8 +155,8 @@ class DeckManagerActivityImpl extends BaseCardsAcitivity implements RecyclerView ...@@ -155,8 +155,8 @@ class DeckManagerActivityImpl extends BaseCardsAcitivity implements RecyclerView
return new DeckInfo(); return new DeckInfo();
} }
mYdkFile = file; mYdkFile = file;
if (mCardLoader.isOpen() && file.exists()) { if (mCardLoader.isOpen() && mYdkFile.exists()) {
return mDeckAdapater.read(mCardLoader, file, mLimitList); return mDeckAdapater.read(mCardLoader, mYdkFile, mLimitList);
} else { } else {
return new DeckInfo(); return new DeckInfo();
} }
......
...@@ -207,13 +207,16 @@ public class ServiceDuelAssistant extends Service { ...@@ -207,13 +207,16 @@ public class ServiceDuelAssistant extends Service {
remoteViews.setOnClickPendingIntent(R.id.buttonStopService, pendingIntent); remoteViews.setOnClickPendingIntent(R.id.buttonStopService, pendingIntent);
NotificationChannel channel = new NotificationChannel(CHANNEL_ID, CHANNEL_NAME, 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); NotificationManager manager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
manager.createNotificationChannel(channel); manager.createNotificationChannel(channel);
Notification.Builder builder = new Notification.Builder(this, CHANNEL_ID); Notification.Builder builder = new Notification.Builder(this, CHANNEL_ID);
builder.setSmallIcon(R.drawable.ic_icon); builder.setSmallIcon(R.drawable.ic_icon);
builder.setSound(null);
builder.setCustomContentView(remoteViews); builder.setCustomContentView(remoteViews);
startForeground(1, builder.build()); startForeground(1, builder.build());
}else { }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