У меня есть следующая xml-структура активности моего приложения. Теперь я хотел бы программно удалить дочерний RelativeLayout с идентификатором layer1Front. Как бы я сделал это в коде. Я не хочу его скрывать, мне нужно удалить его из-за проблем с памятью в моем приложении. Также после его удаления мое приложение будет легче и быстрее, чем текущее?
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/layer1Front" >
</RelativeLayout>
<HorizontalScrollView android:layout_width="wrap_content"
android:layout_height="wrap_content">
<FrameLayout android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:id="@+id/parallaxLayers"
android:visibility="gone">
</FrameLayout>
</HorizontalScrollView>
<RelativeLayout android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/frontView">
</RelativeLayout>
</RelativeLayout>