Replace for loops with foreach
This commit is contained in:
parent
527c7ec54e
commit
42bcb62d2c
2 changed files with 5 additions and 5 deletions
|
|
@ -165,9 +165,9 @@ public class MusicLibraryPagerAdapter extends FragmentPagerAdapter {
|
||||||
|
|
||||||
public static MusicFragments of(Class<?> cl) {
|
public static MusicFragments of(Class<?> cl) {
|
||||||
MusicFragments[] fragments = All.FRAGMENTS;
|
MusicFragments[] fragments = All.FRAGMENTS;
|
||||||
for (int i = 0; i < fragments.length; i++) {
|
for (MusicFragments fragment : fragments) {
|
||||||
if (cl.equals(fragments[i].mFragmentClass))
|
if (cl.equals(fragment.mFragmentClass))
|
||||||
return fragments[i];
|
return fragment;
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new IllegalArgumentException("Unknown music fragment " + cl);
|
throw new IllegalArgumentException("Unknown music fragment " + cl);
|
||||||
|
|
|
||||||
|
|
@ -203,8 +203,8 @@ public abstract class CustomFragmentStatePagerAdapter extends android.support.v4
|
||||||
mSavedState.clear();
|
mSavedState.clear();
|
||||||
mFragments.clear();
|
mFragments.clear();
|
||||||
if (fss != null) {
|
if (fss != null) {
|
||||||
for (int i = 0; i < fss.length; i++) {
|
for (Parcelable fs : fss) {
|
||||||
mSavedState.add((Fragment.SavedState) fss[i]);
|
mSavedState.add((Fragment.SavedState) fs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Iterable<String> keys = bundle.keySet();
|
Iterable<String> keys = bundle.keySet();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue