From dc39cb72afe70dbc6a42ef6a62669dda5603c2c5 Mon Sep 17 00:00:00 2001 From: Hermes Junior Date: Thu, 18 Jun 2020 11:57:47 +0200 Subject: Enable EventBus Index, avoids reflection, and better performance. --- app/src/main/java/ml/docilealligator/infinityforreddit/Infinity.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'app/src') diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Infinity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Infinity.java index 90478a08..04edd825 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/Infinity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Infinity.java @@ -17,6 +17,7 @@ import org.greenrobot.eventbus.EventBus; import ml.docilealligator.infinityforreddit.BroadcastReceiver.NetworkWifiStatusReceiver; import ml.docilealligator.infinityforreddit.Event.ChangeWifiStatusEvent; import ml.docilealligator.infinityforreddit.Utils.Utils; +import ml.docilealligator.inifinityforreddit.EventBusIndex; public class Infinity extends Application { private AppComponent mAppComponent; @@ -42,6 +43,8 @@ public class Infinity extends Application { } }); + EventBus.builder().addIndex(new EventBusIndex()).installDefaultEventBus(); + mNetworkWifiStatusReceiver = new NetworkWifiStatusReceiver(() -> EventBus.getDefault().post(new ChangeWifiStatusEvent(Utils.isConnectedToWifi(getApplicationContext())))); registerReceiver(mNetworkWifiStatusReceiver, new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION)); -- cgit v1.2.3