title: Start application with incoming call
body: <p>I want to launch an application when there is a incoming call.
  1) whenever there is a incoming call a user get a pop up window which ask user which application you want to invoke i) Default telephone application OR ii) MyApplication
  i am using following code</p>
  
  <pre><code>public class Record extends BroadcastReceiver {
      @Override
      public void onReceive(Context arg0, Intent arg1) {
          Bundle bundle=arg1.getExtras();
          String state=bundle.getString(TelephonyManager.EXTRA_STATE);
  
          if(state.equalsIgnoreCase(TelephonyManager.EXTRA_STATE_RINGING))
          {
              Intent i=new Intent(arg0,TempDemoActivity.class);
              arg0.startActivity(i);
          }       
      }
  }
  </code></pre>
  
  <p>Manifest </p>
  
  <pre><code>&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="temp.demo"
      android:versionCode="1"
      android:versionName="1.0" &gt;
  
      &lt;uses-sdk android:minSdkVersion="7" /&gt;
  
      &lt;uses-permission android:name="android.permission.READ_PHONE_STATE" /&gt;
  
      &lt;application
          android:icon="@drawable/ic_launcher"
          android:label="@string/app_name" &gt;
  
          &lt;activity
              android:name=".TempDemoActivity"
              android:label="@string/app_name" &gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MAIN" /&gt;
                  &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
  
          &lt;receiver android:name=".Record" &gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.PHONE_STATE" /&gt;
              &lt;/intent-filter&gt;
          &lt;/receiver&gt;
      &lt;/application&gt;
  
  &lt;/manifest&gt;    
  </code></pre>