0
0
mirror of https://github.com/TrianguloY/UrlChecker.git synced 2024-09-19 20:02:16 +02:00

fix shortcut (#229)

closes #228
This commit is contained in:
TrianguloY 2023-05-14 12:07:42 +02:00 committed by GitHub
parent b594e27b84
commit 1adf96e31f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -83,6 +83,9 @@
<action android:name="android.intent.action.CREATE_SHORTCUT" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
</intent-filter>
</activity>
<service

View File

@ -35,8 +35,9 @@ public class ShortcutsActivity extends Activity {
if (Intent.ACTION_CREATE_SHORTCUT.equals(getIntent().getAction())) {
// old android method
setResult(RESULT_OK, new Intent()
.putExtra(Intent.EXTRA_SHORTCUT_INTENT, new Intent(this, getClass()))
.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
.putExtra(Intent.EXTRA_SHORTCUT_INTENT, new Intent(this, getClass())
.setAction(Intent.ACTION_VIEW)
)
.putExtra(Intent.EXTRA_SHORTCUT_NAME, getString(R.string.shortcut_checkClipboard))
.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE, Intent.ShortcutIconResource.fromContext(this, R.mipmap.clipboard_launcher))
);