title: Java (Android) - With PHP a IsLoggedIn Method
body: <p>I will make a IsLoggedIn Function with PHP (because i check again the name and password in db), but i get a NetworkOnMainThreadException in my logcat.
  What is wrong?</p>
  
  <pre><code>public boolean LoggedIn() {
      try {
          int success;
          List&lt;NameValuePair&gt; params = new ArrayList&lt;NameValuePair&gt;();
          params.add(new BasicNameValuePair("username", username));
          params.add(new BasicNameValuePair("password", password));
          JSONObject json = jsonParser.makeHttpRequest(CHECK_URL, "POST", params);
          success = json.getInt(TAG_SUCCESS);
          if(success == 1) {
              return true;
          }
      } catch (JSONException e) {
          e.printStackTrace();
      } 
      return false;
  }
  </code></pre>