Fixes on pR
This commit is contained in:
parent
a1116dfe33
commit
4f7c662bc9
1 changed files with 15 additions and 20 deletions
|
@ -1707,7 +1707,6 @@ public class OsmandAidlApi {
|
|||
String appPackage = entry.getKey();
|
||||
for (NavDrawerItem item : entry.getValue()) {
|
||||
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(item.uri));
|
||||
boolean isCopy = false;
|
||||
if (intent.resolveActivity(pm) == null) {
|
||||
intent = pm.getLaunchIntentForPackage(appPackage);
|
||||
}
|
||||
|
@ -1716,25 +1715,21 @@ public class OsmandAidlApi {
|
|||
intent.addFlags(item.flags);
|
||||
}
|
||||
final Intent finalIntent = intent;
|
||||
for (String s : adapter.getItemNames()) {
|
||||
if (item.name.equals(s)) {
|
||||
isCopy = true;
|
||||
}
|
||||
}
|
||||
if (!isCopy) {
|
||||
adapter.addItem(new ContextMenuItem.ItemBuilder()
|
||||
.setId(item.getId())
|
||||
.setTitle(item.name)
|
||||
.setIcon(getIconId(item.iconName))
|
||||
.setListener(new ContextMenuAdapter.ItemClickListener() {
|
||||
@Override
|
||||
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int position, boolean isChecked, int[] viewCoordinates) {
|
||||
activity.startActivity(finalIntent);
|
||||
return true;
|
||||
}
|
||||
})
|
||||
.createItem());
|
||||
}
|
||||
|
||||
adapter.addItem(new ContextMenuItem.ItemBuilder()
|
||||
.setId(item.getId())
|
||||
.setTitle(item.name)
|
||||
.setIcon(getIconId(item.iconName))
|
||||
.setListener(new ContextMenuAdapter.ItemClickListener() {
|
||||
@Override
|
||||
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter,
|
||||
int itemId, int position, boolean isChecked,
|
||||
int[] viewCoordinates) {
|
||||
activity.startActivity(finalIntent);
|
||||
return true;
|
||||
}
|
||||
})
|
||||
.createItem());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue