Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error:(8, 26) error: cannot find symbol class ShortcutInfo #11

Closed
JP1016 opened this issue Mar 11, 2017 · 2 comments
Closed

Error:(8, 26) error: cannot find symbol class ShortcutInfo #11

JP1016 opened this issue Mar 11, 2017 · 2 comments

Comments

@JP1016
Copy link

JP1016 commented Mar 11, 2017

package shortbread;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.TaskStackBuilder;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ShortcutInfo;
import android.graphics.drawable.Icon;
import com.devzapps.irctcquicktatkalbooking.Activity.TicketViewer;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

@SuppressLint({
"NewApi",
"ResourceType"
})
public final class ShortbreadGenerated {
public static List<List> createShortcuts(Context context) {
List enabledShortcuts = new ArrayList<>();
List disabledShortcuts = new ArrayList<>();
enabledShortcuts.add(new ShortcutInfo.Builder(context, "ticket_list")
.setShortLabel("My Tickets")
.setIcon(Icon.createWithResource(context, 2130837744))
.setIntents(TaskStackBuilder.create(context)
.addParentStack(TicketViewer.class)
.addNextIntent(new Intent(context, TicketViewer.class)
.setAction(Intent.ACTION_VIEW))
.getIntents())
.setRank(0)
.build());
return Arrays.asList(enabledShortcuts, disabledShortcuts);
}

public static void callMethodShortcut(Activity activity) {
}

}

Error on ShortBreadGenerated.java

@MatthiasRobbers
Copy link
Owner

Make sure that your compileSdkVersion and targetSdkVersion are at least 25. App shortcuts is an Android 7.1 feature.

@JP1016
Copy link
Author

JP1016 commented Mar 12, 2017

Sorry!! My mistake

@JP1016 JP1016 closed this as completed Mar 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants