I am trying to set the visibility of two linear layouts when running an asynctask. Here is my code:

```
private LinearLayout mProgress;
private LinearLayout mList;
mProgress.setOnSystemUiVisibilityChangeListener(new View.OnSystemUiVisibilityChangeListener() {

            @Override
            public void onSystemUiVisibilityChange(int visibility) {
                mList.setVisibility((mProgress.getVisibility() == View.VISIBLE ? View.INVISIBLE : View.VISIBLE));               
            }
        });

//When I run asynctask
@Override
protected void onPreExecute() {
    super.onPreExecute();
    mProgress.setVisibility(View.VISIBLE);
}

@Override
protected void onPostExecute() {                
        mProgress.setVisibility(View.GONE);
}

```

By rights this should set mProgress to visible all the way until onPostExecute. From there, I set the visibility to GONE, which should make my other Linear Layout visible correct? However, when I run this, mProgress is never set to VISIBLE from onPreExecute, and when the Visibility is changed, mList is never set to VISIBLE. Any idea what I am doing wrong?