I've got an issue where setting visibility in my onResumeFragments
method doesn't seem to work. Here's the Activity in question:
public class MainActivity extends FragmentActivity {
private ViewGroup activityBar;
@Override
protected void onCreate(Bundle savedInstanceState) {
activityBar = (ViewGroup)findViewById(R.id.activity_bar);
}
@Override
protected void onResumeFragments() {
if (someCondition) {
activityBar.setVisibility(View.GONE);
}
}
}
The activity bar looks like this:
<LinearLayout
android:id="@+id/activity_bar"
android:layout_height="@dimen/activity_bar_height"
android:layout_width="match_parent"
android:orientation="horizontal"
android:background="#AD000000"
android:layout_alignParentTop="true"
android:gravity="center_vertical"
android:visibility="visible"
>
I've taken out lots of other details, but basically, I want to hide this activity bar in my onResumeFragments
if a given condition is met. What I've found is that the setVisibility
doesn't seem to do anything. I can call getVisiblity
on the activityBar after that line is called and see it set to GONE, but it's still shows up in the UI. I can also set it's Y and see it move down the screen. I've also double checked to make sure this is happening in the Main thread. I'm sort of at a loss for why this isn't working and what the best workaround is.