here is my simple solution: 1) Create a service (do not forget to add it to Manifest.xml).
2) Add the ImageView (or other view) that you want to draw in your window. You must specify the exact location on the screen using LayoutParams initialization.
3) OnTouchListener , , MotionEvent.ACTION_UP ( ), ( , ).
4) Manifest.xml :
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
5) , onDestroy() :
@Override
public void onDestroy() {
super.onDestroy();
if (ivCrumpledPaper != null) {
mWindowManager.removeView(ivCrumpledPaper);
ivCrumpledPaper = null;
}
if (ivRecycleBin != null) {
mWindowManager.removeView(ivRecycleBin);
ivRecycleBin = null;
}
}
6) :

7) , -