title: How to Send ArrayList into different class
body: <p>I really confused to think the way to send ArrayList into different class, i have  an ArrayList named = AgenList and i want to send it into different class that extend BaseAdapter, is there anyone that can help me to solve my problem..?
  this is my source code :
  1. MainActivity.java</p>
  
  <pre><code>public class MainActivity extends Activity {    
  List AgenList = new ArrayList();
  boolean boolStatusKoneksi=true;
  private ProgressDialog Dialog;
  protected Context applicationContext;
  
  
  
  @Override
  public void onCreate(Bundle savedInstanceState){
      new AgenAsyncTask().execute();
      super.onCreate(savedInstanceState);     
      setContentView(R.layout.mainmenu);
      GridView gridview = (GridView) findViewById(R.id.gridview);
      gridview.setAdapter(new TesAdapter(this));
  }
  public class AgenAsyncTask extends AsyncTask&lt;String, String, String&gt;
  {
  
  @Override
      protected void onPreExecute() {
          super.onPreExecute();
          Dialog = new ProgressDialog(MainActivity.this);
          Dialog.setMessage("Mohon Tunggu sebentar...");
          Dialog.setIndeterminate(false);
          Dialog.setCancelable(true);
          Dialog.show();
      }
  protected String doInBackground(String... args) {
  
  
  String url = ("http://www.abc.com/xyz.php");
                try{
                    JSONParser j=new JSONParser();
                      JSONArray jsonArray = j.takeJson(url);
                    for(int i =0; i&lt;jsonArray.length(); i++)
                    {
                        JSONObject c  = jsonArray.getJSONObject(i);
                          HashMap&lt;String, String&gt; map = new HashMap&lt;String, String&gt;();
                          if (c.has("atasan")) 
                              map.put("atasan", c.get("atasan").toString());
                          if (c.has("nama_agen")) 
                              map.put("nama_agen", c.get("nama_agen").toString());
                          if (c.has("kode_agen")) 
                              map.put("kode_agen", c.get("kode_agen").toString());
                          if (c.has("no_aaji")) 
                              map.put("no_aaji", c.get("no_aaji").toString());
                          if (c.has("jenis")) 
                              map.put("jenis", c.get("jenis").toString());
                            AgenList.add(map);
  
  
                       }
                  } catch (JSONException e) {
                      e.printStackTrace();
                      }
                return null;
                  }
      @Override
  protected void onPostExecute(String arg) {Dialog.dismiss();}
  </code></pre>
  
  <p>As you see, i have an arrayList Named AgenList that containing JSONArray that i want to send into TesAdapter.java
  so this is the TesAdapter.java :</p>
  
  <pre><code>public class TesAdapter extends BaseAdapter{
  private LayoutInflater layout;
  
  public TesAdapter(MainActivity context) {
  layout = LayoutInflater.from(context);
  List AgenList = new ArrayList();
  }
  
  @Override
  public int getCount() {
      return (Integer) null;
  }
  
  @Override
  public Object getItem(int position) {
      return 0;
  }
  
          @Override
          public long getItemId(int position) {
              return position;
          }
  
      @Override
      public View getView(int position, View convertView, ViewGroup parent) {
          ViewHolder holder;
  
          convertView= layout.inflate(R.layout.list_item,parent,false);
          holder = new ViewHolder();
  
          holder.ATASAN = (TextView) convertView.findViewById(R.id.atasan);
          holder.NAMA_AGEN= (TextView) convertView.findViewById(R.id.nama_agen);
          holder.KODE_AGEN= (TextView)convertView.findViewById(R.id.kode_agen);
          holder.NO_AAJI= (TextView) convertView.findViewById(R.id.no_aaji);
          holder.JENIS= (TextView) convertView.findViewById(R.id.jenis);
          return convertView;
  
      }
  
  }
  
   class ViewHolder{
      TextView ATASAN;
      TextView NAMA_AGEN;
      TextView KODE_AGEN;
      TextView NO_AAJI;
      TextView JENIS;
  
  }
  </code></pre>
  
  <p>i hope somebody can help me to solve this problem, thanks</p>