|
@@ -23,6 +23,13 @@ import com.vanniktech.emoji.ios.IosEmojiProvider;
|
|
|
|
|
|
import androidx.annotation.RequiresApi;
|
|
|
|
|
|
+import io.reactivex.rxjava3.annotations.NonNull;
|
|
|
+import io.reactivex.rxjava3.core.Observable;
|
|
|
+import io.reactivex.rxjava3.core.ObservableEmitter;
|
|
|
+import io.reactivex.rxjava3.core.ObservableOnSubscribe;
|
|
|
+import io.reactivex.rxjava3.core.Scheduler;
|
|
|
+import io.reactivex.rxjava3.functions.Consumer;
|
|
|
+import io.reactivex.rxjava3.schedulers.Schedulers;
|
|
|
import io.rong.imkit.IMCenter;
|
|
|
import io.rong.push.RongPushClient;
|
|
|
import io.rong.push.pushconfig.PushConfig;
|
|
@@ -44,12 +51,18 @@ public class App extends BaseApplication {
|
|
|
}
|
|
|
|
|
|
private void initMidFile() {
|
|
|
- new Thread(new Runnable() {
|
|
|
+ Observable.create(new ObservableOnSubscribe<Object>() {
|
|
|
@Override
|
|
|
- public void run() {
|
|
|
+ public void subscribe(@NonNull ObservableEmitter<Object> emitter) throws Throwable {
|
|
|
FileUtils.CopyMidiFile(App.this);
|
|
|
}
|
|
|
- }).start();
|
|
|
+ }).observeOn(Schedulers.io())
|
|
|
+ .subscribeOn(Schedulers.io())
|
|
|
+ .subscribe(new Consumer<Object>() {
|
|
|
+ @Override
|
|
|
+ public void accept(Object o) throws Throwable {
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
private void initSDK() {
|