title: troubled passing data from asynctask to fragment
body: <p>I seek to receive data from AsyncTask inside a fragment. I'm aware to achieve this with activity but having difficulties in fragment.</p>
  
  <p>GetResult class</p>
  
  <pre><code>public interface GetResult {
  
      void getData(ArrayList&lt;String&gt; result);
  
  }
  </code></pre>
  
  <p>myFrag class</p>
  
  <pre><code>public class myFrag extends Fragment implements GetResult{
  
      public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
  
          view = inflater.inflate(R.layout.myFrag_layout, container, false);
          Button myBtn = (Button) view.findViewById(R.id.Button1);
  
          myBtn.setOnClickListener(new View.OnClickListener() {
  
              @Override
              public void onClick(View arg0) {
                  myAsync obj = new myAsync();
                  obj.setListener(getActivity());
  
              }
          });
  
      }
  }
  </code></pre>
  
  <p>myAsync class</p>
  
  <pre><code>public class myAsync extends AsyncTask&lt;Void, Void, String&gt;{
      GetResult interfaceObj = null;
  
      public void setListener( GetResult interfaceObj ) {
      this.interfaceObj =  interfaceObj;
      }
  }
  </code></pre>
  
  <p>I'm having problem with obj.setListener(getActivity). It say The method setListener(GetResult) in the  type myAsync is not applicable for the arguments (FragmentActivity). Thanks in advance to everyone.</p>