title: Call a Fragment method from an Adapter
body: <p>I have a method <code>sendData()</code> in my fragment. This method starts a new Activity. I want to call this method from my <code>ArrayAdapter</code>.</p>
  
  <p>Here is my code:-</p>
  
  <p>HomeFragment.java</p>
  
  <pre><code>stagAdaper = new StaggeredAdapter(myContext, android.R.layout.simple_list_item_1, getList);
              mGridView.setAdapter(stagAdaper);
      private void sendData(int position)
      {
  
          myDialog = new ProgressDialog(myContext).show(getActivity(), "Fetching news..", "Just a moment");
  
          myDialog.getWindow().setContentView(R.layout.openarticlewaitprogress);
          myDialog.getWindow().setTitle("Loading..");
          myDialog.getWindow().setLayout(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);
           new  NewsDetails(myDialog);
  
  
  
              Intent nIntent = new Intent(getActivity(),Details.class);
  
                 String Body=getList.get(position).getBody();
  
              newsIntent.putExtra("Body", Body);
  
  
              startActivity(nIntent);
  
      }
  </code></pre>
  
  <p>StaggeredAdapter.java</p>
  
  <pre><code>viewHolder.layGridLayout.setOnClickListener(new View.OnClickListener() 
      {
  
          @Override
          public void onClick(View v) 
          {
              // TODO Auto-generated method stub
              //viewHolder.layGridLayout.setForeground(R.drawable.foreground_selector);
  
          }
      });
      return convertView;
      }
  </code></pre>
  
  <p>How can I do it?</p>