Added version check for app shortcuts
As mentioned by @arkon 2e1a453e8d (commitcomment-21247880)
This commit is contained in:
parent
34f2f8b936
commit
b14ba65a5b
2 changed files with 6 additions and 3 deletions
|
|
@ -7,6 +7,7 @@ import android.content.pm.ShortcutInfo;
|
|||
import android.content.pm.ShortcutManager;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.Icon;
|
||||
import android.os.Build;
|
||||
|
||||
import com.kabouzeid.gramophone.appshortcuts.shortcuttype.LastAddedShortcutType;
|
||||
import com.kabouzeid.gramophone.appshortcuts.shortcuttype.ShuffleAllShortcutType;
|
||||
|
|
@ -20,7 +21,7 @@ import java.util.List;
|
|||
* @author Adrian Campos
|
||||
*/
|
||||
|
||||
@TargetApi(25)
|
||||
@TargetApi(Build.VERSION_CODES.N_MR1)
|
||||
public class DynamicShortcutManager {
|
||||
|
||||
Context mContext;
|
||||
|
|
|
|||
|
|
@ -114,8 +114,10 @@ public class MainActivity extends AbsSlidingMusicPanelActivity {
|
|||
checkShowChangelog();
|
||||
}
|
||||
|
||||
//Set up dynamic shortcuts if needed
|
||||
new DynamicShortcutManager(getApplicationContext()).initDynamicShortcuts();
|
||||
//Set up dynamic shortcuts
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1) {
|
||||
new DynamicShortcutManager(getApplicationContext()).initDynamicShortcuts();
|
||||
}
|
||||
}
|
||||
|
||||
private void setMusicChooser(int key) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue