mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-20 19:42:45 +00:00
Fix crash in onPause(). Fix IP address display in nvComputer.toString(). Increase mDNS response timeout to 1 second.
This commit is contained in:
parent
43e4af0c8b
commit
baf01b93e3
@ -29,8 +29,6 @@ public class Connection extends Activity {
|
|||||||
private static final String DEFAULT_HOST = "192.168.1.240";
|
private static final String DEFAULT_HOST = "192.168.1.240";
|
||||||
public static final String HOST_KEY = "hostText";
|
public static final String HOST_KEY = "hostText";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onResume() {
|
public void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
@ -58,20 +56,18 @@ public class Connection extends Activity {
|
|||||||
Log.v("NvmDNS", "onCreate");
|
Log.v("NvmDNS", "onCreate");
|
||||||
|
|
||||||
|
|
||||||
NvmDNS dns = new NvmDNS();
|
NvmDNS dns = new NvmDNS();
|
||||||
dns.execute();
|
dns.execute();
|
||||||
|
|
||||||
|
|
||||||
setContentView(R.layout.activity_connection);
|
setContentView(R.layout.activity_connection);
|
||||||
|
|
||||||
|
|
||||||
this.statusButton = (Button) findViewById(R.id.statusButton);
|
this.statusButton = (Button) findViewById(R.id.statusButton);
|
||||||
this.pairButton = (Button) findViewById(R.id.pairButton);
|
this.pairButton = (Button) findViewById(R.id.pairButton);
|
||||||
this.hostText = (TextView) findViewById(R.id.hostTextView);
|
this.hostText = (TextView) findViewById(R.id.hostTextView);
|
||||||
|
|
||||||
|
prefs = getPreferences(0);
|
||||||
//prefs = getPreferences(0);
|
this.hostText.setText(prefs.getString(Connection.HOST_KEY, Connection.DEFAULT_HOST));
|
||||||
//this.hostText.setText(prefs.getString(Connection.HOST_KEY, Connection.DEFAULT_HOST));
|
|
||||||
|
|
||||||
this.statusButton.setOnClickListener(new OnClickListener() {
|
this.statusButton.setOnClickListener(new OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -96,7 +96,7 @@ public class NvComputer {
|
|||||||
returnStringBuilder.append("\n|- Hostname: ");
|
returnStringBuilder.append("\n|- Hostname: ");
|
||||||
returnStringBuilder.append(this.hostname);
|
returnStringBuilder.append(this.hostname);
|
||||||
returnStringBuilder.append("\n|- IP Address: ");
|
returnStringBuilder.append("\n|- IP Address: ");
|
||||||
returnStringBuilder.append(this.ipAddress.toString());
|
returnStringBuilder.append(this.ipAddressString);
|
||||||
returnStringBuilder.append("\n|- Computer State: ");
|
returnStringBuilder.append("\n|- Computer State: ");
|
||||||
returnStringBuilder.append(this.state);
|
returnStringBuilder.append(this.state);
|
||||||
returnStringBuilder.append("\n|- Number of Apps: ");
|
returnStringBuilder.append("\n|- Number of Apps: ");
|
||||||
|
@ -33,7 +33,7 @@ public class NvmDNS extends AsyncTask<Void, Integer, Void> {
|
|||||||
public static InetAddress MDNS_MULTICAST_ADDRESS;
|
public static InetAddress MDNS_MULTICAST_ADDRESS;
|
||||||
public static final short MDNS_PORT = 5353;
|
public static final short MDNS_PORT = 5353;
|
||||||
|
|
||||||
public static final int WAIT_MS = 100;
|
public static final int WAIT_MS = 1000;
|
||||||
|
|
||||||
private HashSet<NvComputer> responses;
|
private HashSet<NvComputer> responses;
|
||||||
private MulticastSocket socket;
|
private MulticastSocket socket;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user