diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java | 1 | ||||
-rw-r--r-- | src/github/daneren2005/dsub/fragments/SubsonicFragment.java | 10 |
2 files changed, 7 insertions, 4 deletions
diff --git a/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java b/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java index e6b0e137..00bbd049 100644 --- a/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java +++ b/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java @@ -81,6 +81,7 @@ public class SelectDirectoryFragment extends SubsonicFragment implements Adapter int tmp = bundle.getInt(Constants.FRAGMENT_ID, -1);
if(tmp > 0) {
rootId = tmp;
+ maximizeIdGenerator(tmp);
}
entries = (List<MusicDirectory.Entry>) bundle.getSerializable(Constants.FRAGMENT_LIST);
restoredInstance = true;
diff --git a/src/github/daneren2005/dsub/fragments/SubsonicFragment.java b/src/github/daneren2005/dsub/fragments/SubsonicFragment.java index 07aed372..a9d62d0b 100644 --- a/src/github/daneren2005/dsub/fragments/SubsonicFragment.java +++ b/src/github/daneren2005/dsub/fragments/SubsonicFragment.java @@ -362,10 +362,6 @@ public class SubsonicFragment extends Fragment { }
protected int getNewId() {
- if(rootView != null && Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
- return rootView.generateViewId();
- }
-
for (;;) {
final int result = nextGeneratedId.get();
// aapt-generated IDs have the high byte nonzero; clamp to the range under that.
@@ -376,6 +372,12 @@ public class SubsonicFragment extends Fragment { }
}
}
+ protected void maximizeIdGenerator(int id) {
+ final int result = nextGeneratedId.get();
+ if(id >= result) {
+ nextGeneratedId.set(id + 1);
+ }
+ }
public int getRootId() {
return rootView.getId();
}
|