There is a layout, in which the application can be added to the view or removed from it. It may happen that all views from the layout will be deleted. Is it possible to somehow check if the layout is empty?
Like that:
if (R.id.layout1 == (пуст ?) ) {что-то там происходит}