Replace code for SDK version lower than 14
This commit is contained in:
parent
b1c212c2fc
commit
89366d97d1
|
@ -39,7 +39,6 @@ import de.test.antennapod.util.syndication.feedgenerator.RSS2Generator;
|
||||||
* Utility methods for UI tests.
|
* Utility methods for UI tests.
|
||||||
* Starts a web server that hosts feeds, episodes and images.
|
* Starts a web server that hosts feeds, episodes and images.
|
||||||
*/
|
*/
|
||||||
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
|
|
||||||
public class UITestUtils {
|
public class UITestUtils {
|
||||||
|
|
||||||
private static final String TAG = UITestUtils.class.getSimpleName();
|
private static final String TAG = UITestUtils.class.getSimpleName();
|
||||||
|
@ -49,7 +48,6 @@ public class UITestUtils {
|
||||||
public static final int NUM_FEEDS = 5;
|
public static final int NUM_FEEDS = 5;
|
||||||
public static final int NUM_ITEMS_PER_FEED = 10;
|
public static final int NUM_ITEMS_PER_FEED = 10;
|
||||||
|
|
||||||
public static final int HOME_VIEW = (Build.VERSION.SDK_INT >= 11) ? android.R.id.home : R.id.home;
|
|
||||||
public static final String TEST_FILE_NAME = "3sec.mp3";
|
public static final String TEST_FILE_NAME = "3sec.mp3";
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -41,10 +41,8 @@ public class PodcastApp extends Application {
|
||||||
.detectLeakedSqlLiteObjects()
|
.detectLeakedSqlLiteObjects()
|
||||||
.penaltyLog()
|
.penaltyLog()
|
||||||
.penaltyDropBox();
|
.penaltyDropBox();
|
||||||
if (Build.VERSION.SDK_INT >= 11) {
|
builder.detectActivityLeaks();
|
||||||
builder.detectActivityLeaks();
|
builder.detectLeakedClosableObjects();
|
||||||
builder.detectLeakedClosableObjects();
|
|
||||||
}
|
|
||||||
if(Build.VERSION.SDK_INT >= 16) {
|
if(Build.VERSION.SDK_INT >= 16) {
|
||||||
builder.detectLeakedRegistrationObjects();
|
builder.detectLeakedRegistrationObjects();
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,16 +88,10 @@ public class FeedInfoActivity extends AppCompatActivity {
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
if(feed != null && feed.getDownload_url() != null) {
|
if(feed != null && feed.getDownload_url() != null) {
|
||||||
String url = feed.getDownload_url();
|
String url = feed.getDownload_url();
|
||||||
if (android.os.Build.VERSION.SDK_INT >= 11) {
|
ClipData clipData = ClipData.newPlainText(url, url);
|
||||||
ClipData clipData = ClipData.newPlainText(url, url);
|
android.content.ClipboardManager cm = (android.content.ClipboardManager) FeedInfoActivity.this
|
||||||
android.content.ClipboardManager cm = (android.content.ClipboardManager) FeedInfoActivity.this
|
.getSystemService(Context.CLIPBOARD_SERVICE);
|
||||||
.getSystemService(Context.CLIPBOARD_SERVICE);
|
cm.setPrimaryClip(clipData);
|
||||||
cm.setPrimaryClip(clipData);
|
|
||||||
} else {
|
|
||||||
android.text.ClipboardManager cm = (android.text.ClipboardManager) FeedInfoActivity.this
|
|
||||||
.getSystemService(Context.CLIPBOARD_SERVICE);
|
|
||||||
cm.setText(url);
|
|
||||||
}
|
|
||||||
Toast t = Toast.makeText(FeedInfoActivity.this, R.string.copied_url_msg, Toast.LENGTH_SHORT);
|
Toast t = Toast.makeText(FeedInfoActivity.this, R.string.copied_url_msg, Toast.LENGTH_SHORT);
|
||||||
t.show();
|
t.show();
|
||||||
}
|
}
|
||||||
|
|
|
@ -112,9 +112,7 @@ public class ItemDescriptionFragment extends Fragment implements MediaplayerInfo
|
||||||
Bundle savedInstanceState) {
|
Bundle savedInstanceState) {
|
||||||
Log.d(TAG, "Creating view");
|
Log.d(TAG, "Creating view");
|
||||||
webvDescription = new WebView(getActivity().getApplicationContext());
|
webvDescription = new WebView(getActivity().getApplicationContext());
|
||||||
if (Build.VERSION.SDK_INT >= 11) {
|
webvDescription.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
|
||||||
webvDescription.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
|
|
||||||
}
|
|
||||||
TypedArray ta = getActivity().getTheme().obtainStyledAttributes(new int[]
|
TypedArray ta = getActivity().getTheme().obtainStyledAttributes(new int[]
|
||||||
{android.R.attr.colorBackground});
|
{android.R.attr.colorBackground});
|
||||||
int backgroundColor = ta.getColor(0, UserPreferences.getTheme() ==
|
int backgroundColor = ta.getColor(0, UserPreferences.getTheme() ==
|
||||||
|
@ -238,17 +236,11 @@ public class ItemDescriptionFragment extends Fragment implements MediaplayerInfo
|
||||||
ShareUtils.shareLink(getActivity(), selectedURL);
|
ShareUtils.shareLink(getActivity(), selectedURL);
|
||||||
break;
|
break;
|
||||||
case R.id.copy_url_item:
|
case R.id.copy_url_item:
|
||||||
if (android.os.Build.VERSION.SDK_INT >= 11) {
|
ClipData clipData = ClipData.newPlainText(selectedURL,
|
||||||
ClipData clipData = ClipData.newPlainText(selectedURL,
|
selectedURL);
|
||||||
selectedURL);
|
android.content.ClipboardManager cm = (android.content.ClipboardManager) getActivity()
|
||||||
android.content.ClipboardManager cm = (android.content.ClipboardManager) getActivity()
|
.getSystemService(Context.CLIPBOARD_SERVICE);
|
||||||
.getSystemService(Context.CLIPBOARD_SERVICE);
|
cm.setPrimaryClip(clipData);
|
||||||
cm.setPrimaryClip(clipData);
|
|
||||||
} else {
|
|
||||||
android.text.ClipboardManager cm = (android.text.ClipboardManager) getActivity()
|
|
||||||
.getSystemService(Context.CLIPBOARD_SERVICE);
|
|
||||||
cm.setText(selectedURL);
|
|
||||||
}
|
|
||||||
Toast t = Toast.makeText(getActivity(),
|
Toast t = Toast.makeText(getActivity(),
|
||||||
R.string.copied_url_msg, Toast.LENGTH_SHORT);
|
R.string.copied_url_msg, Toast.LENGTH_SHORT);
|
||||||
t.show();
|
t.show();
|
||||||
|
|
|
@ -184,8 +184,7 @@ public class ItemFragment extends Fragment implements OnSwipeGesture {
|
||||||
}
|
}
|
||||||
webvDescription = (WebView) layout.findViewById(R.id.webvDescription);
|
webvDescription = (WebView) layout.findViewById(R.id.webvDescription);
|
||||||
if (UserPreferences.getTheme() == R.style.Theme_AntennaPod_Dark) {
|
if (UserPreferences.getTheme() == R.style.Theme_AntennaPod_Dark) {
|
||||||
if (Build.VERSION.SDK_INT >= 11
|
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1) {
|
||||||
&& Build.VERSION.SDK_INT <= Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1) {
|
|
||||||
webvDescription.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
|
webvDescription.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
|
||||||
}
|
}
|
||||||
webvDescription.setBackgroundColor(ContextCompat.getColor(getContext(), R.color.black));
|
webvDescription.setBackgroundColor(ContextCompat.getColor(getContext(), R.color.black));
|
||||||
|
@ -483,17 +482,11 @@ public class ItemFragment extends Fragment implements OnSwipeGesture {
|
||||||
ShareUtils.shareLink(getActivity(), selectedURL);
|
ShareUtils.shareLink(getActivity(), selectedURL);
|
||||||
break;
|
break;
|
||||||
case R.id.copy_url_item:
|
case R.id.copy_url_item:
|
||||||
if (android.os.Build.VERSION.SDK_INT >= 11) {
|
ClipData clipData = ClipData.newPlainText(selectedURL,
|
||||||
ClipData clipData = ClipData.newPlainText(selectedURL,
|
selectedURL);
|
||||||
selectedURL);
|
android.content.ClipboardManager cm = (android.content.ClipboardManager) getActivity()
|
||||||
android.content.ClipboardManager cm = (android.content.ClipboardManager) getActivity()
|
.getSystemService(Context.CLIPBOARD_SERVICE);
|
||||||
.getSystemService(Context.CLIPBOARD_SERVICE);
|
cm.setPrimaryClip(clipData);
|
||||||
cm.setPrimaryClip(clipData);
|
|
||||||
} else {
|
|
||||||
android.text.ClipboardManager cm = (android.text.ClipboardManager) getActivity()
|
|
||||||
.getSystemService(Context.CLIPBOARD_SERVICE);
|
|
||||||
cm.setText(selectedURL);
|
|
||||||
}
|
|
||||||
Toast t = Toast.makeText(getActivity(),
|
Toast t = Toast.makeText(getActivity(),
|
||||||
R.string.copied_url_msg, Toast.LENGTH_SHORT);
|
R.string.copied_url_msg, Toast.LENGTH_SHORT);
|
||||||
t.show();
|
t.show();
|
||||||
|
|
|
@ -350,16 +350,6 @@ public class ItemlistFragment extends ListFragment {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setListAdapter(ListAdapter adapter) {
|
|
||||||
// This workaround prevents the ListFragment from setting a list adapter when its state is restored.
|
|
||||||
// This is only necessary on API 10 because addFooterView throws an internal exception in this case.
|
|
||||||
if (Build.VERSION.SDK_INT > 10 || insideOnFragmentLoaded) {
|
|
||||||
super.setListAdapter(adapter);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onViewCreated(View view, Bundle savedInstanceState) {
|
public void onViewCreated(View view, Bundle savedInstanceState) {
|
||||||
super.onViewCreated(view, savedInstanceState);
|
super.onViewCreated(view, savedInstanceState);
|
||||||
|
|
|
@ -230,12 +230,8 @@ public class PreferenceController implements SharedPreferences.OnSharedPreferenc
|
||||||
.setOnPreferenceChangeListener(
|
.setOnPreferenceChangeListener(
|
||||||
(preference, newValue) -> {
|
(preference, newValue) -> {
|
||||||
Intent i = new Intent(activity, MainActivity.class);
|
Intent i = new Intent(activity, MainActivity.class);
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
|
i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK
|
||||||
i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK
|
| Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
| Intent.FLAG_ACTIVITY_NEW_TASK);
|
|
||||||
} else {
|
|
||||||
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
|
||||||
}
|
|
||||||
activity.finish();
|
activity.finish();
|
||||||
activity.startActivity(i);
|
activity.startActivity(i);
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -269,10 +269,8 @@ public class PlaybackService extends MediaBrowserServiceCompat {
|
||||||
Intent.ACTION_HEADSET_PLUG));
|
Intent.ACTION_HEADSET_PLUG));
|
||||||
registerReceiver(shutdownReceiver, new IntentFilter(
|
registerReceiver(shutdownReceiver, new IntentFilter(
|
||||||
ACTION_SHUTDOWN_PLAYBACK_SERVICE));
|
ACTION_SHUTDOWN_PLAYBACK_SERVICE));
|
||||||
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
|
registerReceiver(bluetoothStateUpdated, new IntentFilter(
|
||||||
registerReceiver(bluetoothStateUpdated, new IntentFilter(
|
BluetoothA2dp.ACTION_CONNECTION_STATE_CHANGED));
|
||||||
BluetoothA2dp.ACTION_CONNECTION_STATE_CHANGED));
|
|
||||||
}
|
|
||||||
registerReceiver(audioBecomingNoisy, new IntentFilter(
|
registerReceiver(audioBecomingNoisy, new IntentFilter(
|
||||||
AudioManager.ACTION_AUDIO_BECOMING_NOISY));
|
AudioManager.ACTION_AUDIO_BECOMING_NOISY));
|
||||||
registerReceiver(skipCurrentEpisodeReceiver, new IntentFilter(
|
registerReceiver(skipCurrentEpisodeReceiver, new IntentFilter(
|
||||||
|
@ -342,9 +340,7 @@ public class PlaybackService extends MediaBrowserServiceCompat {
|
||||||
unregisterReceiver(autoStateUpdated);
|
unregisterReceiver(autoStateUpdated);
|
||||||
unregisterReceiver(headsetDisconnected);
|
unregisterReceiver(headsetDisconnected);
|
||||||
unregisterReceiver(shutdownReceiver);
|
unregisterReceiver(shutdownReceiver);
|
||||||
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
|
unregisterReceiver(bluetoothStateUpdated);
|
||||||
unregisterReceiver(bluetoothStateUpdated);
|
|
||||||
}
|
|
||||||
unregisterReceiver(audioBecomingNoisy);
|
unregisterReceiver(audioBecomingNoisy);
|
||||||
unregisterReceiver(skipCurrentEpisodeReceiver);
|
unregisterReceiver(skipCurrentEpisodeReceiver);
|
||||||
unregisterReceiver(pausePlayCurrentEpisodeReceiver);
|
unregisterReceiver(pausePlayCurrentEpisodeReceiver);
|
||||||
|
@ -1196,21 +1192,19 @@ public class PlaybackService extends MediaBrowserServiceCompat {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
Log.d(TAG, "Starting background work");
|
Log.d(TAG, "Starting background work");
|
||||||
if (android.os.Build.VERSION.SDK_INT >= 11) {
|
if (info.playable != null) {
|
||||||
if (info.playable != null) {
|
int iconSize = getResources().getDimensionPixelSize(
|
||||||
int iconSize = getResources().getDimensionPixelSize(
|
android.R.dimen.notification_large_icon_width);
|
||||||
android.R.dimen.notification_large_icon_width);
|
try {
|
||||||
try {
|
icon = Glide.with(PlaybackService.this)
|
||||||
icon = Glide.with(PlaybackService.this)
|
.load(info.playable.getImageLocation())
|
||||||
.load(info.playable.getImageLocation())
|
.asBitmap()
|
||||||
.asBitmap()
|
.diskCacheStrategy(ApGlideSettings.AP_DISK_CACHE_STRATEGY)
|
||||||
.diskCacheStrategy(ApGlideSettings.AP_DISK_CACHE_STRATEGY)
|
.centerCrop()
|
||||||
.centerCrop()
|
.into(iconSize, iconSize)
|
||||||
.into(iconSize, iconSize)
|
.get();
|
||||||
.get();
|
} catch (Throwable tr) {
|
||||||
} catch (Throwable tr) {
|
Log.e(TAG, "Error loading the media icon for the notification", tr);
|
||||||
Log.e(TAG, "Error loading the media icon for the notification", tr);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (icon == null) {
|
if (icon == null) {
|
||||||
|
@ -1471,13 +1465,11 @@ public class PlaybackService extends MediaBrowserServiceCompat {
|
||||||
private final BroadcastReceiver bluetoothStateUpdated = new BroadcastReceiver() {
|
private final BroadcastReceiver bluetoothStateUpdated = new BroadcastReceiver() {
|
||||||
@Override
|
@Override
|
||||||
public void onReceive(Context context, Intent intent) {
|
public void onReceive(Context context, Intent intent) {
|
||||||
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
|
if (TextUtils.equals(intent.getAction(), BluetoothA2dp.ACTION_CONNECTION_STATE_CHANGED)) {
|
||||||
if (TextUtils.equals(intent.getAction(), BluetoothA2dp.ACTION_CONNECTION_STATE_CHANGED)) {
|
int state = intent.getIntExtra(BluetoothA2dp.EXTRA_STATE, -1);
|
||||||
int state = intent.getIntExtra(BluetoothA2dp.EXTRA_STATE, -1);
|
if (state == BluetoothA2dp.STATE_CONNECTED) {
|
||||||
if (state == BluetoothA2dp.STATE_CONNECTED) {
|
Log.d(TAG, "Received bluetooth connection intent");
|
||||||
Log.d(TAG, "Received bluetooth connection intent");
|
unpauseIfPauseOnDisconnect(true);
|
||||||
unpauseIfPauseOnDisconnect(true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -350,9 +350,7 @@ public class PodDBAdapter {
|
||||||
SQLiteDatabase newDb = null;
|
SQLiteDatabase newDb = null;
|
||||||
try {
|
try {
|
||||||
newDb = dbHelper.getWritableDatabase();
|
newDb = dbHelper.getWritableDatabase();
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
|
newDb.enableWriteAheadLogging();
|
||||||
newDb.enableWriteAheadLogging();
|
|
||||||
}
|
|
||||||
} catch (SQLException ex) {
|
} catch (SQLException ex) {
|
||||||
Log.e(TAG, Log.getStackTraceString(ex));
|
Log.e(TAG, Log.getStackTraceString(ex));
|
||||||
newDb = dbHelper.getReadableDatabase();
|
newDb = dbHelper.getReadableDatabase();
|
||||||
|
@ -473,11 +471,7 @@ public class PodDBAdapter {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (!db.inTransaction()) {
|
if (!db.inTransaction()) {
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
|
db.beginTransactionNonExclusive();
|
||||||
db.beginTransactionNonExclusive();
|
|
||||||
} else {
|
|
||||||
db.beginTransaction();
|
|
||||||
}
|
|
||||||
startedTransaction = true;
|
startedTransaction = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -580,11 +574,7 @@ public class PodDBAdapter {
|
||||||
*/
|
*/
|
||||||
public void setCompleteFeed(Feed... feeds) {
|
public void setCompleteFeed(Feed... feeds) {
|
||||||
try {
|
try {
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
|
db.beginTransactionNonExclusive();
|
||||||
db.beginTransactionNonExclusive();
|
|
||||||
} else {
|
|
||||||
db.beginTransaction();
|
|
||||||
}
|
|
||||||
for (Feed feed : feeds) {
|
for (Feed feed : feeds) {
|
||||||
setFeed(feed);
|
setFeed(feed);
|
||||||
if (feed.getItems() != null) {
|
if (feed.getItems() != null) {
|
||||||
|
@ -665,11 +655,7 @@ public class PodDBAdapter {
|
||||||
|
|
||||||
public void setFeedItemlist(List<FeedItem> items) {
|
public void setFeedItemlist(List<FeedItem> items) {
|
||||||
try {
|
try {
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
|
db.beginTransactionNonExclusive();
|
||||||
db.beginTransactionNonExclusive();
|
|
||||||
} else {
|
|
||||||
db.beginTransaction();
|
|
||||||
}
|
|
||||||
for (FeedItem item : items) {
|
for (FeedItem item : items) {
|
||||||
setFeedItem(item, true);
|
setFeedItem(item, true);
|
||||||
}
|
}
|
||||||
|
@ -684,11 +670,7 @@ public class PodDBAdapter {
|
||||||
public long setSingleFeedItem(FeedItem item) {
|
public long setSingleFeedItem(FeedItem item) {
|
||||||
long result = 0;
|
long result = 0;
|
||||||
try {
|
try {
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
|
db.beginTransactionNonExclusive();
|
||||||
db.beginTransactionNonExclusive();
|
|
||||||
} else {
|
|
||||||
db.beginTransaction();
|
|
||||||
}
|
|
||||||
result = setFeedItem(item, true);
|
result = setFeedItem(item, true);
|
||||||
db.setTransactionSuccessful();
|
db.setTransactionSuccessful();
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
|
@ -814,11 +796,7 @@ public class PodDBAdapter {
|
||||||
public void setFeedItemRead(int played, long itemId, long mediaId,
|
public void setFeedItemRead(int played, long itemId, long mediaId,
|
||||||
boolean resetMediaPosition) {
|
boolean resetMediaPosition) {
|
||||||
try {
|
try {
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
|
db.beginTransactionNonExclusive();
|
||||||
db.beginTransactionNonExclusive();
|
|
||||||
} else {
|
|
||||||
db.beginTransaction();
|
|
||||||
}
|
|
||||||
ContentValues values = new ContentValues();
|
ContentValues values = new ContentValues();
|
||||||
|
|
||||||
values.put(KEY_READ, played);
|
values.put(KEY_READ, played);
|
||||||
|
@ -846,11 +824,7 @@ public class PodDBAdapter {
|
||||||
*/
|
*/
|
||||||
public void setFeedItemRead(int read, long... itemIds) {
|
public void setFeedItemRead(int read, long... itemIds) {
|
||||||
try {
|
try {
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
|
db.beginTransactionNonExclusive();
|
||||||
db.beginTransactionNonExclusive();
|
|
||||||
} else {
|
|
||||||
db.beginTransaction();
|
|
||||||
}
|
|
||||||
ContentValues values = new ContentValues();
|
ContentValues values = new ContentValues();
|
||||||
for (long id : itemIds) {
|
for (long id : itemIds) {
|
||||||
values.clear();
|
values.clear();
|
||||||
|
@ -933,11 +907,7 @@ public class PodDBAdapter {
|
||||||
public void setFavorites(List<FeedItem> favorites) {
|
public void setFavorites(List<FeedItem> favorites) {
|
||||||
ContentValues values = new ContentValues();
|
ContentValues values = new ContentValues();
|
||||||
try {
|
try {
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
|
db.beginTransactionNonExclusive();
|
||||||
db.beginTransactionNonExclusive();
|
|
||||||
} else {
|
|
||||||
db.beginTransaction();
|
|
||||||
}
|
|
||||||
db.delete(TABLE_NAME_FAVORITES, null, null);
|
db.delete(TABLE_NAME_FAVORITES, null, null);
|
||||||
for (int i = 0; i < favorites.size(); i++) {
|
for (int i = 0; i < favorites.size(); i++) {
|
||||||
FeedItem item = favorites.get(i);
|
FeedItem item = favorites.get(i);
|
||||||
|
@ -1000,11 +970,7 @@ public class PodDBAdapter {
|
||||||
public void setQueue(List<FeedItem> queue) {
|
public void setQueue(List<FeedItem> queue) {
|
||||||
ContentValues values = new ContentValues();
|
ContentValues values = new ContentValues();
|
||||||
try {
|
try {
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
|
db.beginTransactionNonExclusive();
|
||||||
db.beginTransactionNonExclusive();
|
|
||||||
} else {
|
|
||||||
db.beginTransaction();
|
|
||||||
}
|
|
||||||
db.delete(TABLE_NAME_QUEUE, null, null);
|
db.delete(TABLE_NAME_QUEUE, null, null);
|
||||||
for (int i = 0; i < queue.size(); i++) {
|
for (int i = 0; i < queue.size(); i++) {
|
||||||
FeedItem item = queue.get(i);
|
FeedItem item = queue.get(i);
|
||||||
|
@ -1066,11 +1032,7 @@ public class PodDBAdapter {
|
||||||
*/
|
*/
|
||||||
public void removeFeed(Feed feed) {
|
public void removeFeed(Feed feed) {
|
||||||
try {
|
try {
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
|
db.beginTransactionNonExclusive();
|
||||||
db.beginTransactionNonExclusive();
|
|
||||||
} else {
|
|
||||||
db.beginTransaction();
|
|
||||||
}
|
|
||||||
if (feed.getImage() != null) {
|
if (feed.getImage() != null) {
|
||||||
removeFeedImage(feed.getImage());
|
removeFeedImage(feed.getImage());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue