Fixing shortcuts for native hardware.
This commit is contained in:
parent
f850026304
commit
6e16a093e8
Binary file not shown.
@ -17,6 +17,7 @@
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<action android:name="android.content.Intent.ACTION_CREATE_SHORTCUT" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
|
@ -84,7 +84,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
return;
|
||||
}
|
||||
Intent targetIntent = new Intent(MainActivity.this.getApplicationContext(), MainActivity.class);
|
||||
targetIntent.setAction(Intent.ACTION_DEFAULT);
|
||||
targetIntent.setAction(Intent.ACTION_VIEW);
|
||||
targetIntent.putExtra("url", url);
|
||||
Log.w("BurguillosInfo", "Created intent " + url + " " + shortLabel);
|
||||
|
||||
@ -100,17 +100,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
.build();
|
||||
Log.w("BurguillosInfo", "Built pin.");
|
||||
|
||||
Intent pinnedShortcutCallbackIntent =
|
||||
shortcutManager.createShortcutResultIntent(pinShortcutInfo);
|
||||
Log.w("BurguillosInfo", "created pin.");
|
||||
|
||||
PendingIntent successCallback = PendingIntent.getBroadcast(MainActivity.this, 0,
|
||||
pinnedShortcutCallbackIntent,
|
||||
PendingIntent.FLAG_IMMUTABLE);
|
||||
Log.w("BurguillosInfo", "added success pin.");
|
||||
|
||||
shortcutManager.requestPinShortcut(pinShortcutInfo,
|
||||
successCallback.getIntentSender());
|
||||
shortcutManager.requestPinShortcut(pinShortcutInfo, null);
|
||||
Log.w("BurguillosInfo", "added request pin.");
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user