private static Shortcut from(Card.Apps c, String ident){
String[] parts = ident.split("\\|");
Context ctx = c.getWrapper().getContext();
if(parts[0].equals("shortcut4") && parts.length >= 5){
try {
Resources res = ctx.getPackageManager().getResourcesForApplication(parts[1]);
int drawableIdent = res.getIdentifier(parts[4], "drawable", parts[1]);
Drawable icon = res.getDrawable(drawableIdent);
String uri = decodeText(parts[2]);
Intent intent = Intent.parseUri(uri, Intent.URI_INTENT_SCHEME);
return new Shortcut(parts[3], icon, parts[1], intent, drawableIdent);
} catch (PackageManager.NameNotFoundException | URISyntaxException |
Resources.NotFoundException ignored) {
}
}
return null;
}
App.java 文件源码
java
阅读 46
收藏 0
点赞 0
评论 0
项目:sflauncher
作者:
评论列表
文章目录