There is not option to permanent hide but you can achieve by this way
1.Remove the specific view
by
parent.removeViewAt(index);
parent.removeView(view);
you have to save the state to show/hide
the view
on permanent storage like
Share preference / databases
Shared Preference Example
1.store value in sharedPrefernces
:
SharedPreferences preferences = this.getSharedPreferences("SoldiPreferences", Context.MODE_PRIVATE);
SharedPreferences.Editor editor = preferences.edit();
editor.putBoolean("storevalue", false);
editor.commit();
2.get value from sharedPreferences
:
SharedPreferences preferences = this.getSharedPreferences("SoldiPreferences", Context.MODE_PRIVATE);
preferences.getBoolean("storevalue", false);
if(preferences.getBoolean("storevalue", false))
{
view.setVisibility(View.VISIBLE);
}
else
view.setVisibility(View.GONE);