transfering variable value from BaseExpandableListAdapter class to new activity
<p>I have the following code for ExtendableListAdapter class which extends to BaseExpandableListAdapter. 
I am trying to transfer the value of String variable "FullTrainsURL" to a new Activity. As you can see in code that URL-value for each child list-item is different and specific codes are appended by using OnClick() function.
I have tried</p>

<pre><code>Intent i = new Intent(AdapterForStations.this, TestMain.class);

Bundle b = new Bundle();

b.putString("url", fullTrainsURL);

i.putExtras(b);

startActivity(i);    //Gives error at this line...
</code></pre>

<p>But the class from which i want to transfer the variable to new activity extends to "BaseExpandableListAdapter" other than "Activity". I think that is the reson that i can't use intent.putExtras(); method and i gets the error.</p>

<p>Can you please guide me how can i transfer "fullTrainsURL" variable to new activity by using OnClick() method.</p>

<p>:::::MY ACTUAL FILE CODE:::::</p>

<pre><code>package com.multilayerexpandable.view;

import java.util.ArrayList;
import java.util.LinkedList;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.BaseExpandableListAdapter;
import android.widget.CheckedTextView;
import android.widget.ExpandableListView;
import android.widget.TextView;
import android.widget.Toast;

import com.javacodegeeks.android.xml.pull.R;
import com.javacodegeeks.android.xml.pull.XmlParsingStationsData;
import com.javacodegeeks.android.xml.pull.model.Station;

@SuppressWarnings("unchecked")
public class AdapterForStations extends BaseExpandableListAdapter {

private static final String baseUrlForTrains = "http://cloud.tfl.gov.uk/TrackerNet/PredictionDetailed/";

XmlParsingStationsData parsingStations = new XmlParsingStationsData();
MainStationsActivity stationActivity = new MainStationsActivity();
LinkedList&lt;Station&gt; stationsList = new LinkedList&lt;Station&gt;();

public ArrayList&lt;String&gt; groupItem, tempChild;
public ArrayList&lt;Object&gt; Childtem = new ArrayList&lt;Object&gt;();
public LayoutInflater minflater;
public Activity activity;
private final String TAG = getClass().getSimpleName();



public AdapterForStations(ArrayList&lt;String&gt; grList, ArrayList&lt;Object&gt; childItem) {
    groupItem = grList;
    this.Childtem = childItem;
}

public void setInflater(LayoutInflater mInflater, Activity act) {
    this.minflater = mInflater;
    activity = act;
}

@Override
public Object getChild(int groupPosition, int childPosition) {
    return null;
}

@Override
public long getChildId(int groupPosition, int childPosition) {
    return 0;
}

@Override
public View getChildView(final int groupPosition, final int childPosition,
    boolean isLastChild, View convertView, ViewGroup parent) {
    tempChild = (ArrayList&lt;String&gt;) Childtem.get(groupPosition);

    Log.d(TAG, "::::::::::::::::::::DATA:::::::::::::::::::\n" + "&lt;&lt;&lt;&lt;&lt;&lt;" + tempChild.get(childPosition) + "&gt;&gt;&gt;&gt;&gt;&gt;\n");

    TextView text = null;
    if (convertView == null) {
        convertView = minflater.inflate(R.layout.childrow, null);
    }
    text = (TextView) convertView.findViewById(R.id.textView1);
    text.setText(tempChild.get(childPosition));
    convertView.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View v) {

            StringBuilder trainsUrl = new StringBuilder(baseUrlForTrains);
            String fullTrainsURL = "";

                if(groupItem.get(groupPosition).equals("BAKERLOO LINE")){
                String stationCode = tempChild.get(childPosition).substring(tempChild.get(childPosition).length()-4, tempChild.get(childPosition).length()-1);
                trainsUrl.append("B/").append(stationCode);
                fullTrainsURL = trainsUrl.toString();

                Intent i = new Intent(AdapterForStations.this, TestMain.class);
                Bundle b = new Bundle();
                b.putString("url", fullTrainsURL);
                i.putExtras(b);
                startActivity(i);


            } else if(groupItem.get(groupPosition).equals("CENTRAL LINE")){
                String stationCode = tempChild.get(childPosition).substring(tempChild.get(childPosition).length()-4, tempChild.get(childPosition).length()-1);
                trainsUrl.append("C/").append(stationCode);
                fullTrainsURL = trainsUrl.toString();


            } else if(groupItem.get(groupPosition).equals("CIRCLE LINE")){
                String stationCode = tempChild.get(childPosition).substring(tempChild.get(childPosition).length()-4, tempChild.get(childPosition).length()-1);
                trainsUrl.append("H/").append(stationCode);
                fullTrainsURL = trainsUrl.toString();


            }

            Toast.makeText(activity, fullTrainsURL,
                    Toast.LENGTH_SHORT).show();
            }

    });
    return convertView;
}

@Override
public int getChildrenCount(int groupPosition) {
    return ((ArrayList&lt;String&gt;) Childtem.get(groupPosition)).size();
}

@Override
public Object getGroup(int groupPosition) {
    return null;
}

@Override
public int getGroupCount() {
    return groupItem.size();
}

@Override
public void onGroupCollapsed(int groupPosition) {
    super.onGroupCollapsed(groupPosition);
}

@Override
public void onGroupExpanded(int groupPosition) {
    super.onGroupExpanded(groupPosition);
}

@Override
public long getGroupId(int groupPosition) {
    return 0;
}

@Override
public View getGroupView(int groupPosition, boolean isExpanded,
        View convertView, ViewGroup parent) {
    if (convertView == null) {
        convertView = minflater.inflate(R.layout.grouprow, null);
    }
    ((CheckedTextView) convertView).setText(groupItem.get(groupPosition));
    ((CheckedTextView) convertView).setChecked(isExpanded);
    return convertView;
}

@Override
public boolean hasStableIds() {
    return false;
}

@Override
public boolean isChildSelectable(int groupPosition, int childPosition) {
    return false;
}
</code></pre>

<p>}</p>
