views:

19

answers:

0

i have the following code in a TabHost/TabWdiget for an activity in a Tab that has a ListView that calls my MapView

if(_list.get(position).enabled)
      {
       convertView.setOnClickListener( new OnClickListener()
    {
     public void onClick(View v)
     {
      _context.startActivity(i);
     }
    });
      }

When the animation for the activity transition starts its slow dimming the screen slightly and almost hangs for a moment when transitioning to the MapView. Why is it slow and how can i speed this up? I'm not doing anything that i'm aware of slowing the main UI thread down.

Here is my onCreate from the MapView activity.

@Override
public void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
 requestWindowFeature(Window.FEATURE_LEFT_ICON);
 setContentView(R.layout.map);
 setFeatureDrawableResource(Window.FEATURE_LEFT_ICON, R.drawable.icon);
 setTitle("....TITLE.....");

 mContext = this;
 map=(MapView)findViewById(R.id.mapview);

 LocationUtil loc = new LocationUtil();
 Location location =  loc.getLocation((LocationManager) getSystemService(LOCATION_SERVICE));

 map.getController().setCenter(getPoint(location.getLatitude(),location.getLongitude()));
 map.getController().setZoom(14);
 map.setBuiltInZoomControls(true);

 overlay=new MyLocationOverlay(this, map);
 map.getOverlays().add(overlay);
 spinner = ProgressDialog.show(this, "", "....running background thread AsyncTask...", true,false);
 new OverlayTask().execute(location);
}

On the mapview I have an AsyncTask that is called to get some items for the map in the background. Before i call this AsyncTask i'm popping up a ProgressDialog, not sure if that has anything to do w/ all this. Let me know what parts of the code i need to display that i'm not showing if needed to get help here