[mobile] fix bug

pull/137/head
FongMi 3 years ago
parent dba8503a02
commit 09880be4e7
  1. 4
      app/build.gradle
  2. 3
      app/src/main/java/com/fongmi/android/tv/bean/Config.java
  3. 4
      app/src/mobile/java/com/fongmi/android/tv/service/PlaybackService.java
  4. 1
      app/src/mobile/java/com/fongmi/android/tv/ui/activity/DetailActivity.java
  5. 1
      app/src/mobile/java/com/fongmi/android/tv/ui/activity/LiveActivity.java

@ -21,12 +21,12 @@ android {
leanback {
dimension "mode"
versionCode 200
versionName "20230629#1"
versionName "20230629#2"
}
mobile {
dimension "mode"
versionCode 200
versionName "20230629#1"
versionName "20230629#2"
}
java {
dimension "api"

@ -37,8 +37,7 @@ public class Config {
private String parse;
public static List<Config> arrayFrom(String str) {
Type listType = new TypeToken<List<Config>>() {
}.getType();
Type listType = new TypeToken<List<Config>>() {}.getType();
List<Config> items = new Gson().fromJson(str, listType);
return items == null ? Collections.emptyList() : items;
}

@ -23,10 +23,10 @@ public class PlaybackService extends Service {
}
@Override
public void onCreate() {
super.onCreate();
public int onStartCommand(Intent intent, int flags, int startId) {
NotificationCompat.Builder builder = new NotificationCompat.Builder(this, Notify.DEFAULT).setVisibility(NotificationCompat.VISIBILITY_PUBLIC).setSmallIcon(R.drawable.ic_logo);
startForeground(9527, builder.build());
return START_STICKY;
}
@Nullable

@ -1341,6 +1341,7 @@ public class DetailActivity extends BaseActivity implements Clock.Callback, Cust
mPlayers.release();
Clock.get().release();
RefreshEvent.history();
PlaybackService.stop();
App.removeCallbacks(mR1, mR2, mR3);
mViewModel.result.removeObserver(mObserveDetail);
mViewModel.player.removeObserver(mObservePlayer);

@ -918,6 +918,7 @@ public class LiveActivity extends BaseActivity implements CustomKeyDownLive.List
Force.get().stop();
ZLive.get().stop();
TVBus.get().stop();
PlaybackService.stop();
App.removeCallbacks(mR1, mR2, mR3);
}
}

Loading…
Cancel
Save