Skip to content

Commit

Permalink
Fix minor error regarding local master
Browse files Browse the repository at this point in the history
  • Loading branch information
Perrine Aguiar committed Jun 20, 2017
1 parent 1c03d3a commit 35df499
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ public void run() {
new View.OnClickListener() {
@Override
public void onClick(View view) {
mRunLocalMaster = mSharedPref.getBoolean(getString(R.string.pref_master_is_local_key), false);
mMasterUri = mSharedPref.getString(getString(R.string.pref_master_uri_key),
getResources().getString(R.string.pref_master_uri_default));
mUriTextView.setText(mMasterUri);
Expand Down Expand Up @@ -721,7 +722,7 @@ public void onShutdown(NodeMainExecutorService nodeMainExecutorService) {
// e.g. 'http://android-c90553518bc67cf5:1131'.
// Instead of showing this to the user, we show the IP address of the device,
// which is also correct and less confusing.
WifiManager wifiManager = (WifiManager) getSystemService(WIFI_SERVICE);
WifiManager wifiManager = (WifiManager) getApplicationContext().getSystemService(WIFI_SERVICE);
String deviceIP = Formatter.formatIpAddress(wifiManager.getConnectionInfo().getIpAddress());
mUriTextView = (TextView) findViewById(R.id.master_uri);
mUriTextView.setText("http://" + deviceIP + ":11311");
Expand Down

0 comments on commit 35df499

Please sign in to comment.