I'm trying to change the visibility of the RecyclerView to View.GONE
. However, no changes are taking place:
@Override
public boolean onQueryTextSubmit(String query) {
runOnUiThread(new Runnable() {
@Override
public void run() {
list.setVisibility(View.GONE);
}
});
if (list == null){
throw new NullPointerException();
}
Here's the View:
<android.support.v7.widget.RecyclerView
android:id="@+id/allUsers"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:layout_below="@+id/toolbar_container" />
Removing runOnUiThread
doesn't work, nor does list.invalidate()
. Nothing is crashing. This is in an inner class. What am I doing wrong?