title: how can i break this loop in android studio
body: <p>hi this is the loop how can i break it on that place where i typed I WHANT TO BREAK IT HERE
  thanks in advance for the help and i use android studio to develop my app.</p>
  
  <pre><code>for (int i = 10; i &lt; 100; i++) {
          if (serverconnection.equals("false")) {
              AsyncHttpPost post = new AsyncHttpPost(serveraddress + "/soton/serveraddress.php");
              post.setTimeout(5000);
  
              final int finalI = i;
              AsyncHttpClient.getDefaultInstance().executeString(post, new AsyncHttpClient.StringCallback() {
                  @Override
                  public void onCompleted(final Exception e, AsyncHttpResponse source, final String result) {
  
                      if (e != null) {
                          MainActivity.activity.runOnUiThread(new Runnable() {
                              @Override
                              public void run() {
                                  e.printStackTrace();
                                  servernum = finalI+1;
                                  Toast.makeText(MainActivity.activity, "not this IP:"+ servernum, Toast.LENGTH_SHORT).show();
  
                              }
                          });
                      } else if (result.equals("correct address")) {
                          MainActivity.activity.runOnUiThread(new Runnable() {
                              @Override
                              public void run() {
                                  Toast.makeText(MainActivity.activity,"آدرس جدید پیدا شد",Toast.LENGTH_LONG).show();
                                  serverconnection = "true";
                                  SharedPreferences.Editor editor = sp.edit();
                                  editor.putString("IP", serveraddress+"/");
                                  editor.apply();
                                  I WHANT TO BREAK IT HERE
  
  
  
                              }
                          });
                      }
                  }
              });
          } else {
  
  
              SharedPreferences.Editor editori = sp.edit();
              editori.putString("IP", serveraddress+"/");
              editori.apply();
          }
      }
  </code></pre>