1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| @AfterViews
public void init() {
modeValue.setText(BuildConfig.FLAVOR);
flavorsValue.setText(BuildConfig.BUILD_TYPE);
appVersionValue.setText(BuildConfig.VERSION_NAME);
versionCodeValue.setText(String.valueOf(BuildConfig.VERSION_CODE));
WifiManager wm = (WifiManager) getSystemService(WIFI_SERVICE);
if (wm == null) {
wifiIpValue.setText("No WiFi on this device");
} else {
String ip = Formatter.formatIpAddress(wm.getConnectionInfo().getIpAddress());
if (TextUtils.isEmpty(ip)) {
wifiIpValue.setText("(Error)");
} else {
wifiIpValue.setText(ip);
}
getVersion();
}
} |