title: Cant able to call Async Task
body: <blockquote>
    <p>I have an issue of calling AsyncTask.I am calling AsyncTask inside
    button but its not going for do in background and onPost execute.
    After clicking button nothing happens. Please help me to rectify
    mistake.</p>
  </blockquote>
  
  <p><strong>Photo.class</strong></p>
  
  <pre><code>public View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState) {
      View takephoto_view = inflater.inflate(R.layout.fragment_profile, null,false);
      img_profile = (ImageView)takephoto_view.findViewById(R.id.profile_imgphoto);
      but_takephoto = (Button)takephoto_view.findViewById(R.id.profile_buttakephoto);
      but_savephoto = (Button)takephoto_view.findViewById(R.id.profile_butsavephoto);
      but_takephoto.setOnClickListener(listener_takephoto);
      but_savephoto.setOnClickListener(new OnClickListener() {
  
          @Override
          public void onClick(View v) {
              firstmethod();
          }
      });
  
      return takephoto_view;
  }
  
  
  public void firstmethod() {
      new MyAsyn(getActivity()).execute();
  }
  
  public class MyAsyn extends AsyncTask&lt;String, String, String&gt; {
      Context con;
  
      public MyAsyn(Context con) {
          this.con = con;
      }
  
      @Override
      protected String doInBackground(String... params) {
          // Create a new HttpClient and Post Header
  //          HttpClient httpclient = new DefaultHttpClient();
  //         
  //
  //          StringBuilder sb;
  //          try {
  //              
  //              StringEntity se = new StringEntity(json);
  //             
  //              httppost.setEntity(se);
  //              System.out.print(json);
  //              HttpResponse response = httpclient.execute(httppost);
  //              if(response != null)
  //              {
  //                  InputStream is = response.getEntity().getContent();
  //   
  //                  BufferedReader reader = new BufferedReader(new InputStreamReader(is));
  //                  sb = new StringBuilder();
  //   
  //                  String line = null;
  //                  try {
  //                      while ((line = reader.readLine()) != null) {
  //                          sb.append(line + "\n");
  //                          
  //                      }
  //                      
  //                      
  //                  } catch (IOException e)
  //                  {
  //                      e.printStackTrace();
  //                  } 
  //                  finally {
  //                      try {
  //                          is.close();
  //                      } catch (IOException e) {
  //                          e.printStackTrace();
  //                      }
  //                  }
  //                  
  //                  
  //                  
  //                 
  //              }
  //   
  //              
  //          }catch (ClientProtocolException e) {
  //              // TODO Auto-generated catch block
  //          } catch (IOException e) {
  //              // TODO Auto-generated catch block
  //          }
              return null;
          }
  
      @Override
      protected void onPostExecute(String result) {
          super.onPostExecute(result);
          Toast.makeText(getActivity(), "Hello", Toast.LENGTH_LONG).show();
      }
  
  }
  </code></pre>