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) {
|
||||
MusicFragments[] fragments = All.FRAGMENTS;
|
||||
for (int i = 0; i < fragments.length; i++) {
|
||||
if (cl.equals(fragments[i].mFragmentClass))
|
||||
return fragments[i];
|
||||
for (MusicFragments fragment : fragments) {
|
||||
if (cl.equals(fragment.mFragmentClass))
|
||||
return fragment;
|
||||
}
|
||||
|
||||
throw new IllegalArgumentException("Unknown music fragment " + cl);
|
||||
|
|
|
|||
|
|
@ -203,8 +203,8 @@ public abstract class CustomFragmentStatePagerAdapter extends android.support.v4
|
|||
mSavedState.clear();
|
||||
mFragments.clear();
|
||||
if (fss != null) {
|
||||
for (int i = 0; i < fss.length; i++) {
|
||||
mSavedState.add((Fragment.SavedState) fss[i]);
|
||||
for (Parcelable fs : fss) {
|
||||
mSavedState.add((Fragment.SavedState) fs);
|
||||
}
|
||||
}
|
||||
Iterable<String> keys = bundle.keySet();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue