diff options
author | Scott Jackson <daneren2005@gmail.com> | 2014-02-01 20:08:28 -0800 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2014-02-01 20:08:28 -0800 |
commit | 123271c223d9e038b848cbbdaec79a92cf5d13ba (patch) | |
tree | 84bc1f93b7593fe37b94e028a8684cefa69f648b /src | |
parent | 515c1ec1d941252cf742b842b05dbd9fb787a7d4 (diff) | |
download | dsub-123271c223d9e038b848cbbdaec79a92cf5d13ba.tar.gz dsub-123271c223d9e038b848cbbdaec79a92cf5d13ba.tar.bz2 dsub-123271c223d9e038b848cbbdaec79a92cf5d13ba.zip |
Use native unique id generator on 4.2+
Diffstat (limited to 'src')
-rw-r--r-- | src/github/daneren2005/dsub/fragments/SubsonicFragment.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/github/daneren2005/dsub/fragments/SubsonicFragment.java b/src/github/daneren2005/dsub/fragments/SubsonicFragment.java index e8ae6f1e..07aed372 100644 --- a/src/github/daneren2005/dsub/fragments/SubsonicFragment.java +++ b/src/github/daneren2005/dsub/fragments/SubsonicFragment.java @@ -28,6 +28,7 @@ import android.content.pm.PackageManager; import android.content.pm.ResolveInfo;
import android.media.MediaMetadataRetriever;
import android.net.Uri;
+import android.os.Build;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.util.Log;
@@ -361,6 +362,10 @@ 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.
|