title: How to increase the speed to load an activity?
body: <p>I am developing an Android application and it uses  GoogleMaps. So when I click on a Button, I load a registraPosizioneActivity that shows the google maps. So I have noted that the loading speed of this activity is slow. Is there a mode for increasing the speed of loading this activity?</p>
  
  <p>This is my code:</p>
  
  <pre><code>         protected void onCreate(Bundle savedInstanceState) {
              try{
                  super.onCreate(savedInstanceState);
                  setContentView(R.layout.activity_recordposition);
                  locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);
                  Criteria criteria = new Criteria();
                  criteria.setAccuracy(Criteria.ACCURACY_FINE);
                  provider = locationManager.getBestProvider(criteria, false);
                  locationManager.requestLocationUpdates(provider, 1000, 0, this);
                  settaMappa();
                  if(myPosition==null){
                      pDialog = ProgressDialog.show(this, "Attendere ...", "Localizzazione in corso ...", true);
                      pDialog.setCancelable(false);
                  }
              }catch(Exception e){
                  Log.e("Errore onCreate:",e.getMessage());
                  Utility.generateNoteOnSD(fileName,e.getMessage());
              }
          }
  
         public void settaMappa(){
              mMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map2)).getMap();
              mMap.setMapType(GoogleMap.MAP_TYPE_TERRAIN);
              mMap.setMyLocationEnabled(true);
          }
  </code></pre>
  
  <p>This is activity_recordposition.xml</p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      xmlns:map="http://schemas.android.com/apk/res-auto"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:background="#000000"
      android:orientation="vertical"
      tools:context=".registraPosizioneActivity"
      android:gravity="center"&gt;
  
  
      &lt;fragment 
        android:name="com.google.android.gms.maps.SupportMapFragment"
        android:id="@+id/map2"
        android:layout_height="0dp"
        android:layout_weight="10"
        android:layout_width="match_parent"
        class="com.google.android.gms.maps.SupportMapFragment"
        /&gt;
  
      &lt;LinearLayout
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:layout_weight="1"
          android:gravity="center"
          android:orientation="horizontal" &gt;
  
          &lt;Button
          android:id="@+id/buttonR"
          android:layout_width="0dp"
          android:layout_height="fill_parent"
          android:layout_weight="0.20"
          android:layout_margin="20dp"
          android:background="#0080c2"
          android:textColor="#FFF"
          android:textSize="20sp"
          android:onClick="registraPunto"
          android:text="@string/registraPunto" /&gt;
  
      &lt;Button
          android:id="@+id/buttonSava"
          android:layout_width="0dp"
          android:layout_height="fill_parent"
          android:layout_weight="0.20"
          android:layout_margin="20dp"
          android:background="#0080c2"
          android:textColor="#FFF"
          android:textSize="20sp"
          android:onClick="savaAreaTracciata"
          android:text="@string/terminaRegistrazione" /&gt;
      &lt;/LinearLayout&gt;
  </code></pre>