title: setContentView taking too much time
body: <p>I have activity with MapView, TextView, 3 ImageButton and 1 simple Button. First call setContentView for this activity takes too much time (near 10 seconds). Here is my view code: </p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:gravity="center_horizontal"
      android:padding="0px" &gt;
  
      &lt;com.google.android.maps.MapView
          android:id="@+id/map_view"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent"
          android:layout_below="@+id/txt_route_info"
          android:apiKey="MyAPIKeyGoesHere"
          android:clickable="true"
          android:enabled="true" /&gt;
  
      &lt;Button
          android:id="@+id/btn_accept"
          android:layout_width="fill_parent"
          android:layout_height="55dp"
          android:layout_alignParentBottom="true"
          android:layout_margin="2dip"
          android:enabled="false"
          android:text="@string/btn_accept" /&gt;
  
      &lt;LinearLayout
          xmlns:android="http://schemas.android.com/apk/res/android"
          android:id="@+id/textEdit"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_centerHorizontal="true"
          android:gravity="center_horizontal"
          android:padding="0px" &gt;
  
          &lt;TextView
              android:id="@+id/txt_route_info"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:gravity="center_horizontal" /&gt;
      &lt;/LinearLayout&gt;
  
      &lt;LinearLayout
          xmlns:android="http://schemas.android.com/apk/res/android"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_below="@+id/textEdit"
          android:layout_centerHorizontal="true"
          android:gravity="center_horizontal"
          android:padding="0px" &gt;
  
          &lt;ImageButton
              android:id="@+id/btn_zoom_in"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_weight="1"
              android:contentDescription="@string/btn_zoom_in_content_descriptor"
              android:src="@drawable/zoom_in" /&gt;
  
          &lt;ImageButton
              android:id="@+id/btn_zoom_out"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_weight="1"
              android:contentDescription="@string/btn_zoom_out_content_descriptor"
              android:src="@drawable/zoom_out" /&gt;
  
          &lt;ImageButton
              android:id="@+id/btn_my_location"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_weight="1"
              android:contentDescription="@string/btn_my_location_content_descriptor"
              android:src="@drawable/my_location" /&gt;
      &lt;/LinearLayout&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>I have no idea what can slow activity loading so much. I've read this topic: <a href="https://stackoverflow.com/questions/8180072/setcontentview-taking-long-time-10-15-seconds-to-execute">setContentView taking long time (10-15 seconds) to execute</a> 
  but i still can't solve my problem. If you can give me any hint or idea, I would be thankful.</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>onCreate method from my activity code: </p>
  
  <pre><code>@Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.google_map_view);
      mapView = (MapView) this.findViewById(R.id.map_view);
      mapView.setBuiltInZoomControls(false);
  
      locationManager = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE);
      if (locationManager == null) {
          this.finish();
          return;
      }
  
      final MyLocationOverlay myLocationOverlay = new MyLocationOverlay(this, mapView);
      myLocationOverlay.disableCompass();
      myLocationOverlay.enableMyLocation();
  
      acceptBtn = (Button) findViewById(R.id.btn_accept);
      final View.OnClickListener acceptBtnListener = new AcceptBtnListener();
      acceptBtn.setOnClickListener(acceptBtnListener);
  
      final ImageButton zoomInBtn = (ImageButton) findViewById(R.id.btn_zoom_in);
      final ImageButton zoomOutBtn = (ImageButton) findViewById(R.id.btn_zoom_out);
      myLocationBtn = (ImageButton) findViewById(R.id.btn_my_location);
      zoomInBtn.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
              mapController.zoomIn();
          }
      });
  
      zoomOutBtn.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
              mapController.zoomOut();
          }
      });
  
      myLocationBtn.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
              final GeoPoint myLocation = myLocationOverlay.getMyLocation();
              if (myLocation != null) {
                  mapController.animateTo(myLocation);
                  mapController.setCenter(myLocation);
              } else {
                  progressDialog = ProgressDialog.show(GoogleMapActivity.this, "", getString(R.string.dlg_progress_obtaining_location), true);
              }
          }
      });
  
      mapController = this.mapView.getController();
      mapController.setZoom(MAP_ZOOM_LEVEL);
  
      final Intent intent = getIntent();
      isInRouteMode = intent.getBooleanExtra("isRouteMode", false);  //activity started to display route?
      if (isInRouteMode) {
          final String fromAddress = intent.getStringExtra("fromAddress");
          final String toAddress = intent.getStringExtra("toAddress");
          final GeoPoint fromPoint;
          final GeoPoint toPoint;
          try {
              fromPoint = getGeoPointByAddressString(fromAddress, this);
              toPoint = getGeoPointByAddressString(toAddress, this);
          } catch (IOException e) {
              Toast.makeText(this, getString(R.string.err_geocoder_not_available),
                      Toast.LENGTH_LONG).show();
              Log.e(CLASSTAG, e.getMessage());
              return;
          }
          new RouteCalculationTask().execute(fromPoint, toPoint);
      } else {  //activity started to select address
          addressItemizedOverlay = new AddressItemizedOverlay(getResources().getDrawable(R.drawable.red_pin));
          mapView.getOverlays().add(addressItemizedOverlay);
          mapView.getOverlays().add(myLocationOverlay);
          mapView.setOnTouchListener(new MapOnTouchListener());
      }
  }
  </code></pre>
  
  <p>Priveous activity is simple activity with just four buttons so I belive it can't slow down this activity.  </p>