Skip to content

Commit b8be6e3

Browse files
author
Piotr Wittchen
authored
Merge pull request pwittchen#114 from suclike/updateGreenRobot
Update green robot
2 parents 00c0359 + acfa061 commit b8be6e3

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

example-greenrobot-bus/build.gradle

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ android {
2121

2222
dependencies {
2323
compile(project(':network-events-library'))
24-
compile 'de.greenrobot:eventbus:2.4.1'
24+
25+
// Greenrobot EventBus 3 Beta
26+
compile 'org.greenrobot:eventbus:3.0.0'
2527
compile 'com.android.support:appcompat-v7:22.0.0'
2628
}

example-greenrobot-bus/src/main/java/com/github/pwittchen/networkevents/greenrobot/app/MainActivity.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
import com.github.pwittchen.networkevents.library.NetworkEvents;
2828
import com.github.pwittchen.networkevents.library.event.ConnectivityChanged;
2929
import com.github.pwittchen.networkevents.library.event.WifiSignalStrengthChanged;
30-
import de.greenrobot.event.EventBus;
30+
import org.greenrobot.eventbus.EventBus;
31+
import org.greenrobot.eventbus.Subscribe;
3132
import java.util.ArrayList;
3233
import java.util.List;
3334

@@ -39,12 +40,12 @@ public class MainActivity extends Activity {
3940
private TextView mobileNetworkType;
4041
private ListView accessPoints;
4142

42-
@SuppressWarnings("unused") public void onEvent(ConnectivityChanged event) {
43+
@SuppressWarnings("unused") @Subscribe public void onEvent(ConnectivityChanged event) {
4344
connectivityStatus.setText(event.getConnectivityStatus().toString());
4445
mobileNetworkType.setText(event.getMobileNetworkType().toString());
4546
}
4647

47-
@SuppressWarnings("unused") public void onEvent(WifiSignalStrengthChanged event) {
48+
@SuppressWarnings("unused") @Subscribe public void onEvent(WifiSignalStrengthChanged event) {
4849
List<String> wifiScanResults = new ArrayList<>();
4950

5051
for (ScanResult scanResult : event.getWifiScanResults()) {

0 commit comments

Comments
 (0)