title: Starting Activity via Intent is slow / shows considerable delay - why?
body: <p>I have a very simple MainActivity, and from that Activity I start the other Activity (with theme Dialog so it floats on top of the MainActivity.</p>
  
  <p>The problem is that there is always a delay before the second Activity show up. I'd say it takes almost 1 second for it to show, and there is no code at all in second Activity. The only code in the second Activity is this:</p>
  
  <pre><code>package MyPackage;
  
  import android.app.Activity;
  import android.os.Bundle;
  import android.widget.ArrayAdapter;
  import android.widget.ListView;
  import android.widget.TextView;
  
  public class JobViewActivity extends Activity {
  
      @Override
      protected void onCreate(android.os.Bundle savedInstanceState) 
      {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.jobview);
      }
  
      @Override
      protected void onResume() {
          super.onResume();
      }
  }
  </code></pre>
  
  <p>The MainActivity has a ListView with Nodes, and there is a click listener connected to the ListView in the onCreate like this:</p>
  
  <pre><code>public void onCreate(Bundle savedInstanceState) 
  {
      requestWindowFeature(Window.FEATURE_NO_TITLE);
      super.onCreate(savedInstanceState);
      setContentView(R.layout.main);
  
      _nodeRowAdapter = new NodeRowAdapter(this, _nodes);
  
      listView = (ListView)findViewById(R.id.ListViewNodes);
      listView.setAdapter(_nodeRowAdapter);   
  
      listView.setOnItemClickListener(new OnItemClickListener() {
          public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {
              Intent i = new Intent(getApplicationContext(), JobViewActivity.class);
              startActivity(i);
          }
      });
  </code></pre>
  
  <p>But when the ListItem is pressed, and the Click listener is triggered, it takes about 1 second to show the "popup".</p>
  
  <p>The layout isn't very advanced in the popup. Here is the layout:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" android:weightSum="1" 
    android:stretchColumns="1" android:orientation="vertical"&gt;
  
      &lt;TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
          android:layout_width="fill_parent"
          android:stretchColumns="1" android:layout_height="wrap_content" android:id="@+id/tableLayout1"&gt;
          &lt;TableRow&gt;
              &lt;TextView
                  android:text="Id: "
                  android:padding="10dip"/&gt;
              &lt;TextView
                  android:text="Ext id: "
                  android:gravity="right"
                  android:padding="10dip" /&gt;
          &lt;/TableRow&gt;
       &lt;/TableLayout&gt;
  
  
      &lt;RelativeLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:id="@+id/relativeLayout1"&gt;
          &lt;LinearLayout android:id="@+id/linearLayout1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="#E7F3F1"&gt;
               &lt;Button android:text="Start" android:id="@+id/button1" style="@style/ButtonText" android:layout_weight="1" android:background="@drawable/button_green"&gt;&lt;/Button&gt;
  
              &lt;Button android:text="Bom" android:id="@+id/button2" style="@style/ButtonText" android:layout_weight="1" android:background="@drawable/button_red"&gt;&lt;/Button&gt;
              &lt;Button android:text="Mer" android:id="@+id/button3" style="@style/ButtonText" android:layout_weight="1" android:background="@drawable/button_yellow"&gt;&lt;/Button&gt;
              &lt;Button android:text="Nav" android:id="@+id/button4" style="@style/ButtonText" android:layout_weight="1"&gt;&lt;/Button&gt;
          &lt;/LinearLayout&gt;
      &lt;/RelativeLayout&gt;
  
      &lt;RelativeLayout android:layout_height="fill_parent" android:layout_width="fill_parent" android:layout_below="@+id/tableLayout1" android:layout_alignParentLeft="true" android:layout_above="@+id/relativeLayout1" android:padding="6dip"&gt;
          &lt;TextView style="@style/JobViewHeader" android:id="@+id/textView1" android:text="Something: "&gt;&lt;/TextView&gt;
          &lt;TextView style="@style/JobViewHeader" android:id="@+id/TextView2" android:text="Something: " android:layout_below="@+id/textView1"&gt;&lt;/TextView&gt;
          &lt;TextView style="@style/JobViewHeader" android:id="@+id/TextView3" android:layout_marginTop="16dp" android:text="Kund: " android:layout_below="@+id/TextView2"&gt;&lt;/TextView&gt;
          &lt;TextView style="@style/JobViewHeader" android:id="@+id/TextView4" android:text="Something: " android:layout_below="@+id/TextView3"&gt;&lt;/TextView&gt;
          &lt;TextView style="@style/JobViewHeader" android:id="@+id/TextView5" android:text="Something: " android:layout_below="@+id/TextView4"&gt;&lt;/TextView&gt;
          &lt;TextView style="@style/JobViewHeader" android:id="@+id/TextView6" android:text="Something: " android:layout_below="@+id/TextView5"&gt;&lt;/TextView&gt;
          &lt;TextView style="@style/JobViewHeader" android:id="@+id/TextView7" android:text="Something: " android:layout_below="@+id/TextView6"&gt;&lt;/TextView&gt;
          &lt;TextView style="@style/JobViewHeader" android:id="@+id/TextView8" android:layout_marginTop="20dp" android:text="Something: " android:layout_below="@+id/TextView7"&gt;&lt;/TextView&gt;
  
          &lt;TextView android:layout_height="wrap_content" android:text="TextView" android:layout_width="wrap_content" android:layout_alignBaseline="@+id/textView1" android:layout_alignBottom="@+id/textView1" android:layout_toRightOf="@+id/textView1" android:id="@+id/textViewPickuptime"&gt;&lt;/TextView&gt;
          &lt;TextView android:layout_height="wrap_content" android:text="TextView" android:layout_width="wrap_content" android:layout_alignBaseline="@+id/TextView2" android:layout_alignBottom="@+id/TextView2" android:layout_toRightOf="@+id/TextView2" android:id="@+id/textViewPickupAddress"&gt;&lt;/TextView&gt;
          &lt;TextView android:layout_height="wrap_content" android:text="TextView" android:layout_width="wrap_content" android:layout_above="@+id/TextView4" android:layout_toRightOf="@+id/TextView3" android:id="@+id/textViewCustomer"&gt;&lt;/TextView&gt;
          &lt;TextView android:layout_height="wrap_content" android:text="TextView" android:layout_width="wrap_content" android:layout_alignBaseline="@+id/TextView4" android:layout_alignBottom="@+id/TextView4" android:layout_toRightOf="@+id/TextView4" android:id="@+id/textViewNbrOfPassengers"&gt;&lt;/TextView&gt;
          &lt;TextView android:layout_height="wrap_content" android:text="TextView" android:layout_width="wrap_content" android:layout_above="@+id/TextView6" android:layout_toRightOf="@+id/TextView5" android:id="@+id/textViewRoutine"&gt;&lt;/TextView&gt;
          &lt;TextView android:layout_height="wrap_content" android:text="TextView" android:layout_width="wrap_content" android:layout_alignBaseline="@+id/TextView6" android:layout_alignBottom="@+id/TextView6" android:layout_toRightOf="@+id/TextView6" android:id="@+id/textViewServiceFee"&gt;&lt;/TextView&gt;
          &lt;TextView android:layout_height="wrap_content" android:text="TextView" android:layout_width="wrap_content" android:layout_alignBaseline="@+id/TextView7" android:layout_alignBottom="@+id/TextView7" android:layout_toRightOf="@+id/TextView7" android:id="@+id/textViewHelp"&gt;&lt;/TextView&gt;
          &lt;TextView android:layout_height="wrap_content" android:text="TextView" android:layout_width="wrap_content" android:layout_below="@+id/TextView8" android:layout_alignLeft="@+id/TextView8" android:id="@+id/textViewExtra"&gt;&lt;/TextView&gt;
      &lt;/RelativeLayout&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>Im not sure what else to tell you, there isnt much more too it.</p>
  
  <p>Im testing on a device, Samsung Galaxy S2.</p>