for those who want to add a floating window as I wanted and have problems or do not know how to do here I leave the code I used and the explanation.
Well I will go straight to the point, what I used in a Pop Up Windows, what it does is that through a button it shows us a floating popup window (not as a message). What I mean is that we bring a class in a small window showing it in the same window that we already have (floating) in which we can have and do what we want as if it were another "normal" window and with just one click out of this floating window comes out and shows our background window that we already had.
Here I leave the code (this is a test):
1.- in our MainActivity make a button and try
Intent miintento= new Intent ( getApplicationContext (),PopUpTabla.class );
startActivity ( miintento );
2.- Make a new class (Inside the OnCreate)
DisplayMetrics dn= new DisplayMetrics ();
getWindowManager ().getDefaultDisplay ().getMetrics ( dn );
int width=dn.widthPixels;
int height=dn.heightPixels;
getWindow ().setLayout ( (int)(width*.8),(int)(height*.7));
WindowManager.LayoutParams params= getWindow ().getAttributes ();
params.gravity=Gravity.CENTER;
params.x=0;
params.y=20;
getWindow ().setAttributes ( params );
here you can put more code than you want to show in my case I wanted a Table)
3.- In the Value / Styles add this (put the outline transparently so you can click outside and return to our main window)
<style name="AppTheme.PopMe">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowCloseOnTouchOutside">true</item>
</style>
4.- Add our creation to the Manifest:
<activity android:name=".PopUpTabla"></activity>
(exactly here)
<activity android:name=".PopUpTabla"
android:theme="@style/AppTheme.PopMe"
></activity>
5.- I hope it works for you and mark the answer as correct :)