use Long.toString()

This commit is contained in:
Adrian Ulrich 2016-11-26 16:28:35 +01:00
parent e3c6331885
commit f218271919
4 changed files with 6 additions and 6 deletions

View File

@ -255,7 +255,7 @@ public class CoverCache {
dbh.delete(TABLE_NAME, "1", null);
} else if (availableSpace < 0) {
// Try to evict all expired entries first
int affected = dbh.delete(TABLE_NAME, "expires < ?", new String[] {""+getUnixTime()});
int affected = dbh.delete(TABLE_NAME, "expires < ?", new String[] { Long.toString(getUnixTime())});
if (affected > 0)
availableSpace = maxCacheSize - getUsedSpace();
@ -266,7 +266,7 @@ public class CoverCache {
while (cursor.moveToNext() && availableSpace < 0) {
int id = cursor.getInt(0);
int size = cursor.getInt(1);
dbh.delete(TABLE_NAME, "id=?", new String[] {""+id});
dbh.delete(TABLE_NAME, "id=?", new String[] { Long.toString(id) });
availableSpace += size;
}
cursor.close();
@ -361,7 +361,7 @@ public class CoverCache {
SQLiteDatabase dbh = getWritableDatabase(); // may also delete
String selection = "id=?";
String[] selectionArgs = { ""+key.hashCode() };
String[] selectionArgs = { Long.toString(key.hashCode()) };
Cursor cursor = dbh.query(TABLE_NAME, FULL_PROJECTION, selection, selectionArgs, null, null, null);
if (cursor != null) {
if (cursor.moveToFirst()) {

View File

@ -230,7 +230,7 @@ public class MediaUtils {
public static long queryGenreForSong(Context context, long id) {
String[] projection = { MediaLibrary.GenreSongColumns._GENRE_ID };
String query = MediaLibrary.GenreSongColumns.SONG_ID+"=?";
String[] queryArgs = new String[] { id+"" };
String[] queryArgs = new String[] { Long.toString(id) };
Cursor cursor = MediaLibrary.queryLibrary(context, MediaLibrary.TABLE_GENRES_SONGS, projection, query, queryArgs, null);
if (cursor != null) {

View File

@ -203,7 +203,7 @@ public class Playlist {
boolean found = false;
String selection = MediaLibrary.PlaylistSongColumns.PLAYLIST_ID+"=? AND "+MediaLibrary.PlaylistSongColumns.SONG_ID+"=?";
String[] selectionArgs = { ""+playlistId, ""+song.id };
String[] selectionArgs = { Long.toString(playlistId), Long.toString(song.id) };
Cursor cursor = MediaLibrary.queryLibrary(context, MediaLibrary.TABLE_PLAYLISTS_SONGS, Song.EMPTY_PLAYLIST_PROJECTION, selection, selectionArgs, null);
if (cursor != null) {

View File

@ -55,7 +55,7 @@ public class PreferencesTheme extends PreferenceFragment
pref.setPersistent(false);
pref.setOnPreferenceClickListener(this);
pref.setTitle(entries[i]);
pref.setKey(""+attrs[0]); // that's actually our value
pref.setKey(Long.toString(attrs[0])); // that's actually our value
pref.setIcon(generateThemePreview(attrs));
screen.addPreference(pref);
}