From b79fd8860c8c8b90eb03b5b8b2b11fc5695d5501 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Fri, 4 Jul 2014 11:52:56 -0700 Subject: [PATCH] Warn the user if they've entered nothing to add --- src/com/limelight/AddComputerManually.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/com/limelight/AddComputerManually.java b/src/com/limelight/AddComputerManually.java index e2d8bb49..47eb3f2c 100644 --- a/src/com/limelight/AddComputerManually.java +++ b/src/com/limelight/AddComputerManually.java @@ -86,7 +86,12 @@ public class AddComputerManually extends Activity { addPcButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { - Toast.makeText(AddComputerManually.this, "Adding PC...", Toast.LENGTH_LONG).show(); + if (hostText.getText().length() == 0) { + Toast.makeText(AddComputerManually.this, "You must enter an IP address", Toast.LENGTH_LONG).show(); + return; + } + + Toast.makeText(AddComputerManually.this, "Adding PC...", Toast.LENGTH_SHORT).show(); // Bind to the service which will try to add the PC bindService(new Intent(AddComputerManually.this, ComputerManagerService.class), serviceConnection, Service.BIND_AUTO_CREATE);