title: Android Refreshing Fragment View after AsyncTask
body: <p>I am trying to update list fragment when an <code>AsyncTask</code> in my activity completes but I am not sure if I am doing something wrong. Currently, I have a button that initiates the <code>AsyncTask</code>:</p>
  
  <pre><code>search = (Button)findViewById(R.id.search);
      search.setOnClickListener(
              new View.OnClickListener() {
                  @Override
                  public void onClick(View v) {
                      String productname = prodname.getText().toString().trim();
                      if (NetworkManager.isOnline(getApplicationContext())){
                          // Go to Other screen
                          AsyncFetcher results = new AsyncFetcher(currActivity);
                          String _url = "http://192.168.1.3:3000/search.json?
                                         utf8=%E2%9C%93&amp;q="+productname;
                          // progressDialog = ProgressDialog.show(
                          //    ClassifiedsActivity.this, "", "Loading...");
                          results.execute(_url);
                      } else {
                          // Throw some warning saying no internet 
                          // connection was found
                      }
                  }
              });
  </code></pre>
  
  <p>Once my execute is finished I have following to instantiate fragment within my activity:</p>
  
  <pre><code>ResultFragment resultfrag = new ResultFragment();
  getSupportFragmentManager().beginTransaction()
                             .replace(R.id.content_frame, resultfrag).commit();
  </code></pre>
  
  <p>However it doesnt seem to replace my content with the list fragment.
  Here is my layout file:</p>
  
  <pre><code>&lt;LinearLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:orientation="vertical"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent" &gt;
  
      &lt;FrameLayout
          android:id="@+id/content_frame"
          android:layout_width="match_parent"
          android:layout_height="match_parent" /&gt;
  &lt;/LinearLayout&gt;
  </code></pre>