before android oreo and pie we are using


now we can only use


and this made some issues to my application

before i am overlay two view on WindowManger one using TYPE_SYSTEM_ALERT let's call it view1 and the other using TYPE_PHONE let called view2

this will made my view1 over view2 but in android oreo i have one option only. so how can i z-order Views i have ?

i can't use one view must i have two views one of them add depend on user options and there is some animation prevent me from made them one View so any idea how to make z-order in Oreo and pie

my idea i do it its removing the first View and add it again for make it over all other Views

 private void zOrderView(){
        if(view1== null) return;
         windowManager.addView(view1, params);

but i see its bad because user can notice that's the View removed and add again

0 Answers