First of all, make your layout according to overlay. You set the width and height of match_parent, which is the cover of the entire screen, so you do not get access to an application that is outside of your application.
package anew.mikka.myapplication; import android.app.Service; import android.content.Intent; import android.graphics.PixelFormat; import android.os.IBinder; import android.view.Gravity; import android.view.MotionEvent; import android.view.View; import android.view.WindowManager; import android.view.View.OnTouchListener; import android.widget.Button; import android.widget.Toast; public class max extends Service implements View.OnTouchListener { Button mButton; @Override public IBinder onBind(Intent intent) { return null; } @Override public void onCreate() { super.onCreate();
source share