summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authord34d <clark@cyngn.com>2014-08-20 20:25:50 -0700
committerClark Scheff <clark@cyngn.com>2014-08-21 18:07:51 +0000
commit20a4b2e613da65a37b5277cb54641e2bf7b70104 (patch)
tree76dff602a3f83681583299f9d8e2a2bc9dcf94ea /src
parenteb1622c788f9533df90d1b68cc2bfe780cd7f133 (diff)
downloadpackages_apps_ThemeChooser-20a4b2e613da65a37b5277cb54641e2bf7b70104.zip
packages_apps_ThemeChooser-20a4b2e613da65a37b5277cb54641e2bf7b70104.tar.gz
packages_apps_ThemeChooser-20a4b2e613da65a37b5277cb54641e2bf7b70104.tar.bz2
Use a projection for themes loader and don't call in onCreate
There is no need to be retrieving all columns for all themes so we can use a projection to get just the two columns we want. We were also starting the cursor loader in onCreate() and then again in onResume(). This commit removes the call in onCreate(). Change-Id: Ic12f287034cc7b877d29f3d606309065fd134365
Diffstat (limited to 'src')
-rw-r--r--src/com/cyngn/theme/chooser/ChooserActivity.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/com/cyngn/theme/chooser/ChooserActivity.java b/src/com/cyngn/theme/chooser/ChooserActivity.java
index e6d1fd7..a852df7 100644
--- a/src/com/cyngn/theme/chooser/ChooserActivity.java
+++ b/src/com/cyngn/theme/chooser/ChooserActivity.java
@@ -150,7 +150,6 @@ public class ChooserActivity extends FragmentActivity
mSelector.setOnOpenCloseListener(mOpenCloseListener);
mService = (ThemeManager) getSystemService(Context.THEME_SERVICE);
- getSupportLoaderManager().restartLoader(LOADER_ID_APPLIED, null, this);
mShopThemesLayout = findViewById(R.id.shop_themes_layout);
@@ -592,6 +591,7 @@ public class ChooserActivity extends FragmentActivity
String selection = null;
String selectionArgs[] = null;
String sortOrder = null;
+ String[] projection = null;
Uri contentUri = null;
switch (id) {
@@ -604,6 +604,7 @@ public class ChooserActivity extends FragmentActivity
+ "(" + ThemesColumns.PKG_NAME + "='" + mAppliedBaseTheme + "') DESC, "
+ ThemesColumns.INSTALL_TIME + " DESC";
contentUri = ThemesColumns.CONTENT_URI;
+ projection = new String[] {ThemesColumns.PKG_NAME, ThemesColumns.TITLE};
break;
case LOADER_ID_APPLIED:
//TODO: Mix n match query should only be done once
@@ -614,7 +615,7 @@ public class ChooserActivity extends FragmentActivity
}
- return new CursorLoader(this, contentUri, null, selection,
+ return new CursorLoader(this, contentUri, projection, selection,
selectionArgs, sortOrder);
}