Only clear the empty view on initial launch
prior to the first data load. This fixes
an issue where views were modified in
a non-UI thread (unnecessarily).
Bug: 3307266
Change-Id: I6a3db0932caed9773677214f5f7e05cd00f65fce
diff --git a/src/com/android/apps/tag/MyTagList.java b/src/com/android/apps/tag/MyTagList.java
index 7f330cd..3728b53 100644
--- a/src/com/android/apps/tag/MyTagList.java
+++ b/src/com/android/apps/tag/MyTagList.java
@@ -115,6 +115,11 @@
mList.setOnItemClickListener(this);
findViewById(R.id.add_tag).setOnClickListener(this);
+ // Don't setup the empty view until after the first load
+ // so the empty text doesn't flash when first loading the
+ // activity.
+ mList.setEmptyView(null);
+
// Kick off an async task to load the tags.
new TagLoaderTask().execute((Void[]) null);
@@ -201,10 +206,6 @@
final class TagLoaderTask extends AsyncTask<Void, Void, Cursor> {
@Override
public Cursor doInBackground(Void... args) {
- // Don't setup the empty view until after the first load
- // so the empty text doesn't flash when first loading the
- // activity.
- mList.setEmptyView(null);
Cursor cursor = getContentResolver().query(
NdefMessages.CONTENT_URI,
TagQuery.PROJECTION,