Comment dessiner sur des applications qui tirent sur d'autres applications? - Établissement des priorités?

Ange :

Merci pour votre temps.

Je fais cette application qui affiche une icône sur l'écran d'accueil et d'autres applications (comme messager fb) (voir img1) et lorsque vous appuyez dessus, l'icône montre une nouvelle activité qui a des options (voir img3). Mais a ce problème:

  • L'icône apparaît derrière ma nouvelle activité de recouvrement (voir img3)
  • fb messegner apparaît toujours sur mon application (voir img2)

Donc, je pensais peut-être il y a un moyen de régler les écrans prioritys se chevauchent?

  1. Comment puis-je montrer mon application sur d'autres applications qui attirent aussi sur d'autres applications?

  2. Comment puis-je obtenir la permission du système apparaisse sur l'application du système?

aide s'il vous plaît.

Img1 - Mon application

Img2 - Mon application vs Fb mssgr vs app système

Img3 - Je crée une nouvelle fenêtre de superposition, mais je veux que mon premier icône APPE

Les autorisations sur mon manifeste:

<uses-permission android:name="android.permission.ACTION_MANAGE_OVERLAY_PERMISSION" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="android.permission.CALL_PHONE" />

Le Service de l'icône:

public class ServicioVentanaFlotanteIcono extends Service {


    @Override
    public IBinder onBind(Intent intent) {
        return null;
    }


    @Override
    public void onCreate() {
        super.onCreate();

        // Indica que mostrará el Layout ventana_flotante
        final LayoutInflater inflater = (LayoutInflater) getBaseContext().getSystemService(LAYOUT_INFLATER_SERVICE);
        assert inflater != null;
        @SuppressLint("InflateParams") final View
                customView = inflater.inflate(R.layout.ventana_flotante_icono, null);

        // Inicializa el Windows Manager y muestra el Layout
        wm = (WindowManager) getSystemService(WINDOW_SERVICE);
        final WindowManager.LayoutParams parameters = new WindowManager.LayoutParams(
                WindowManager.LayoutParams.WRAP_CONTENT,
                WindowManager.LayoutParams.WRAP_CONTENT,
                WindowManager.LayoutParams.TYPE_PHONE,
                WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE,
                PixelFormat.TRANSLUCENT);
        wm.addView(customView, parameters);

    ....

    }

}

Le service à la superposition écran gris et blanc icône en bas:

public class ServicioVentanaFlotanteMensajes extends Service {

@Override
public IBinder onBind(Intent intent) {
    return null;
}

public void onCreate() {
        super.onCreate();

        // Indica que mostrará el Layout ventana_flotante_mensajes
        final LayoutInflater inflater = (LayoutInflater) getBaseContext().getSystemService(LAYOUT_INFLATER_SERVICE);
        customView = inflater.inflate(R.layout.ventana_flotante_mensajes, null);

        // Inicializa el Windows Manager y muestra el Layout
        wm = (WindowManager) getSystemService(WINDOW_SERVICE);
        final WindowManager.LayoutParams parameters = new WindowManager.LayoutParams(
                WindowManager.LayoutParams.MATCH_PARENT,
                WindowManager.LayoutParams.MATCH_PARENT,
                WindowManager.LayoutParams.TYPE_PHONE,
                WindowManager.LayoutParams.FLAG_FULLSCREEN,
                PixelFormat.TRANSLUCENT);
        wm.addView(customView, parameters);

    ...
    }
}
Ange :

J'ai trouver un moyen de montrer l'icône sur les applications des autres, il ajoutait la mise en page params pour differents chacun:

À l'écran que vous voulez sur le dessus montre:

LayoutParams.type = WindowManager.LayoutParams.TYPE_PRIORITY_PHONE;

Je suppose que tu aimes

Origine http://43.154.161.224:23101/article/api/json?id=231114&siteId=1
conseillé
Classement