mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2025-10-05 21:39:50 +02:00
Enable EventBus Index, avoids reflection, and better performance.
This commit is contained in:
committed by
OHermesJunior
parent
b5fec7dac7
commit
dc39cb72af
@@ -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));
|
||||
|
Reference in New Issue
Block a user