Note that there are some explanatory texts on larger screens.

plurals
  1. POOverride the True Caller Popup using System Overlay?
    primarykey
    data
    text
    <p>I am actually trying to develop a GUI which can override the Truecaller Popup. For this i guess i have to create a System Overlay with the Message i want to display, using the Window Manager and also i should have a receiver to listen to the intent Phone_State, but some how my code is not working, P Here is the code snippet.</p> <pre><code>This is my receiver... import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.graphics.Color; import android.graphics.PixelFormat; import android.util.Log; import android.view.Gravity; import android.view.WindowManager; import android.view.WindowManager.LayoutParams; import android.widget.LinearLayout; import android.widget.TextView; public class mReceiver extends BroadcastReceiver{ @Override public void onReceive(Context context, Intent intent) { Log.d( "mReceiver" , "Inside mReceiver : First Line " ); WindowManager windowManager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE); WindowManager.LayoutParams params = new WindowManager.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT, WindowManager.LayoutParams.TYPE_SYSTEM_ALERT | WindowManager.LayoutParams.TYPE_SYSTEM_OVERLAY, WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE, PixelFormat.TRANSPARENT ); params.height = LayoutParams.WRAP_CONTENT; params.width = LayoutParams.MATCH_PARENT; params.format = PixelFormat.TRANSLUCENT; params.gravity = Gravity.TOP; LinearLayout ly = new LinearLayout(context); ly.setBackgroundColor(Color.RED); ly.setOrientation(LinearLayout.VERTICAL); TextView tv = new TextView(context); tv.setText("Are We Above Truecaller !!! Cheers Yes We are!!!"); ly.addView(tv); TextView tv2 = new TextView(context); tv2.setText("Are We Above Truecaller !!! Cheers Yes We are!!!"); ly.addView(tv2); TextView tv3 = new TextView(context); tv3.setText("Are We Above Truecaller !!! Cheers Yes We are!!!"); ly.addView(tv3); windowManager.addView(ly, params); } } This is my Manifest.. &lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.deathfinal" android:versionCode="1" android:versionName="1.0" &gt; &lt;uses-sdk android:minSdkVersion="15" android:targetSdkVersion="15" /&gt; &lt;uses-permission android:name="android.permission.READ_PHONE_STATE" /&gt; &lt;uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/&gt; &lt;application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" &gt; &lt;receiver android:name="com.example.deathfinal.mReceiver" android:enabled="true"&gt; &lt;intent-filter android:priority="199"&gt; &lt;action android:name="android.intent.action.PHONE_STATE" /&gt; &lt;category android:name="android.intent.category.HOME" /&gt; &lt;/intent-filter&gt; &lt;/receiver&gt; &lt;/application&gt; &lt;/manifest&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload