title: pass data between classes (not activities) results in nullpointerexception
body: <p>I have an activity <code>ShowList</code> where I have some <code>edittext</code> fields and <code>buttons</code>.
  I have a <code>button</code> "<code>get location</code>" which gets the <code>current location</code> with <code>GPS</code>.</p>
  
  <p>The <code>ShowList activity</code> (which works fine , I can get the <code>location</code>) :</p>
  
  <pre><code>  public class ShowList extends Activity implements OnClickListener{
  
  
  GPSTracker gps;   //i use GPSTracker to get the location (it is not an activity)
       .........
  
   case R.id.getlocation:
      // create class object
     gps = new GPSTracker(ShowList.this);
  
    // check if GPS enabled
   if(gps.canGetLocation()){
  
            double latitude = gps.getLatitude();
            double longitude = gps.getLongitude();
  
  Toast.makeText(getApplicationContext(), "Your Location is - \nLat: " + latitude + "\nLong: " + longitude, Toast.LENGTH_LONG).show();
                      }else{
                          ...
                      }
  </code></pre>
  
  <p>I have a <strong>custom adapter</strong>:</p>
  
  <pre><code>    public class myAdapter extends BaseAdapter{   
           ShowList locationclass=new ShowList();
           .....
          TextView Location = (TextView) convertView.findViewById(R.id.text_location);
  
              String lat=Double.toString(locationclass.gps.getLatitude());
              String lo=Double.toString(locationclass.gps.getLongitude());
              String coordinates="Lat: " + lat + "  Long: " + lo;
              Location.setText(coordinates);
  </code></pre>
  
  <p>I receive the <code>nullpointer</code> in <strong>"String lat..."</strong>.</p>
  
  <p>So, how can I pass the <code>location</code> from <code>ShowList activity</code> to <code>adapter</code>?</p>