¿Cómo abrir una ventana emergente en Android y permitir que todos los demás componentes se puedan tocar sin desestimar la ventana emergente?Abre una ventana emergente y deja que las partes exteriores sigan siendo tocables
Esto es cómo se creó:
public class DynamicPopup {
private final PopupWindow window;
private final RectF rect;
private final View parent;
private final RichPageView view;
public DynamicPopup(Context context, RichPage page, RectF rectF, View parent) {
this.parent = parent;
rect = rectF;
window = new PopupWindow(context);
window.setBackgroundDrawable(new BitmapDrawable());
window.setWidth((int) rect.width());
window.setHeight((int) rect.height());
window.setTouchable(true);
window.setFocusable(true);
window.setOutsideTouchable(true);
view = new RichPageView(context, page, false);
window.setContentView(view);
view.setOnCloseListener(new Listener(){
@Override
public void onAction() {
window.dismiss();
}
});
}
public void show() {
window.showAtLocation(parent, Gravity.NO_GRAVITY, (int) rect.left, (int) rect.top);
}
}
¿Has probado este método? http://developer.android.com/reference/android/widget/PopupWindow.html # setOutsideTouchable% 28boolean% 29 – ernazm
@ernazm, debe mover esto a una respuesta. – Phil
Bueno, no estoy seguro de que este método funcione como estaba previsto, ya que no lo he usado (el SDK de Android tiene muchas cosas problemáticas) y esta pregunta se ha planteado. – ernazm