title: Change android CallScreen
body: <p>I'm developing an app that would change the Call screen UI of the android OS. Now i know, I can't replace the UI, i can overlay my custom activity over it. So that's what i tried to do.</p>
  
  <p>I can receive the intent by <code>android.intent.action.PHONE_STATE</code> of the ringing state and it works fine however when i launch my own activity it goes to the background and android's native UI replaces it. Is there anyway to change that? I don't want to do <code>Thread.sleep()</code> (though as a last resort I might have to).</p>
  
  <p>Here is the code:</p>
  
  <p>Android Manifest:</p>
  
  <pre><code> &lt;receiver android:name=".callIntentReceiver"&gt;
          &lt;intent-filter &gt;
              &lt;action android:name="android.intent.action.PHONE_STATE"/&gt;
          &lt;/intent-filter&gt;
      &lt;/receiver&gt;
  </code></pre>
  
  <p>callIntentReceiver.java:</p>
  
  <pre><code>public class callIntentReceiver extends BroadcastReceiver {
  
      @Override
      public void onReceive(Context context, Intent intent) {
          Log.e("SmartCaller","Working sort of");
          Intent intent = new Intent(context, mainActivity.class);
                  intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK |
                  Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
                  context.startActivity(intent);
  
      }
  }
  </code></pre>