title: how to call Aysnctask in android
body: <p>I am writing an android application, I use Aysnctask to get the current weather using openWeatherAPI. How could I call the Aysnctask class.</p>
  
  <p>this is the Aysnctask class I wrote:</p>
  
  <pre><code>private class getWeather extends AsyncTask&lt;String[], Void, String[]&gt;{
  
      @Override
      protected String[] doInBackground(String[]... params) {
          // TODO Auto-generated method stub
          try {
  
               String Url1="http://api.openweathermap.org/data/2.5/weather?lat="+currentLatitude+"&amp;lon="+currentLongitude;
               s1=getJson(Url1);
  
  
  
               if(s1!=null){
  
  
                   JSONObject jObj1 = new JSONObject(s1);
  
                   Tem=  jObj1.getJSONObject("main").getDouble("temp");
                   pressure=jObj1.getJSONObject("main").getDouble("pressure");
                   humm=jObj1.getJSONObject("main").getDouble("humidity");
                   wind=jObj1.getJSONObject("wind").getDouble("speed");
                   desc=jObj1.getJSONObject("weather").getDouble("description");
  
                        double tem_c=Tem-273.15;
                      String t=Double.toString(tem_c);
                      results[0]=t;
                      results[1]=Double.toString(pressure);
                      results[2]=Double.toString(humm);
                      results[3]=Double.toString(wind);
                      results[4]=Double.toString(desc);
  
               }
  
          } catch (Exception e) {
              // TODO: handle exception
          }
          return results;
      }//do in background
  
  
      @Override
      protected void onPostExecute(String[] results) {    
          temp.setText(results[0]+"°C");
          hum.setText(results[1]+ "%");
          press.setText(results[2]+ " hPa");
          windSpeed.setText(results[3]+ " mps");
          condDescr.setText(results[4]);
  
      }
  
  
  
  }
  </code></pre>
  
  <p>when I press a button, I want to get the weather of current latitude and longitude, but I don't know how to execute the class</p>