android-intent

How to get Spotify and other Android music apps to search and play from an intent?

我是研究僧i 提交于 2020-03-01 18:28:25
问题 I would like to create a MEDIA_PLAY_FROM_SEARCH (or other) intent that will search for and play a song in any major Android music app. I expected the following command line to work on multiple apps: adb shell am start -a "android.media.action.MEDIA_PLAY_FROM_SEARCH" -e android.intent.extra.focus "vnd.android.cursor.item/*" -e query "yellow\ submarine\ by\ the\ beatles" -f 268435456 This corresponds to the code: Intent intent = new Intent(MediaStore.INTENT_ACTION_MEDIA_PLAY_FROM_SEARCH);

How to get Spotify and other Android music apps to search and play from an intent?

送分小仙女□ 提交于 2020-03-01 18:28:18
问题 I would like to create a MEDIA_PLAY_FROM_SEARCH (or other) intent that will search for and play a song in any major Android music app. I expected the following command line to work on multiple apps: adb shell am start -a "android.media.action.MEDIA_PLAY_FROM_SEARCH" -e android.intent.extra.focus "vnd.android.cursor.item/*" -e query "yellow\ submarine\ by\ the\ beatles" -f 268435456 This corresponds to the code: Intent intent = new Intent(MediaStore.INTENT_ACTION_MEDIA_PLAY_FROM_SEARCH);

How to exclude URLs with Android Intent Filters?

懵懂的女人 提交于 2020-03-01 05:17:50
问题 I saw some intent filters like this one. <data android:scheme="http" android:host="m.facebook.com" android:pathPattern=".*"/> Facebook app throws URLs like http://m.facebook.com/l.php?u=http%3A%2F%2Fyoutu.be%2FBsKtRwSyLmM&h=9AQF5nU03&s=1 I want to open those urls that contain youtu.be but NOT user (as I want to open videos in the app not user profiles). 回答1: I have been looking for something similar, and apparently you can only filter the actual path (in this case "l.php") and not the query

Set Default Android Launcher on Huawei devices?

此生再无相见时 提交于 2020-02-29 04:23:13
问题 My Goal is here is to set my app as default launcher on Huawei devices. 1 - Explanations: 1.1 - Current situation: I am already able to: Check if my app is the default launcher Display the 'launcher picker' (with the 'use once' / 'always' choice) This all works fine.. except on Huawei devices! From my point of view, Huawei's Android flavor does not properly 'honor' the "ACTION_MANAGE_DEFAULT_APPS_SETTINGS" intent action contract. // this displays the list of default apps on all tested devices

Set Default Android Launcher on Huawei devices?

懵懂的女人 提交于 2020-02-29 04:22:47
问题 My Goal is here is to set my app as default launcher on Huawei devices. 1 - Explanations: 1.1 - Current situation: I am already able to: Check if my app is the default launcher Display the 'launcher picker' (with the 'use once' / 'always' choice) This all works fine.. except on Huawei devices! From my point of view, Huawei's Android flavor does not properly 'honor' the "ACTION_MANAGE_DEFAULT_APPS_SETTINGS" intent action contract. // this displays the list of default apps on all tested devices

How to add flags with my intent in the manifest file

≡放荡痞女 提交于 2020-02-27 04:30:50
问题 we know that there are flags which we can add to our intent using the addFlags() method in our java code. Is there any way we can add these flags in the manifest file itself instead of writing this in java code. I need to add REORDER_TO_FRONT flag for one of my activities in the manifest. How to achieve this ? 回答1: In manifest file you can not add Intent flags.You need to set the flag in Intent which u pass to startActivity. Here is a sample: Intent intent = new Intent(this,

how to start an activity in another module explicitly

拈花ヽ惹草 提交于 2020-02-26 08:00:05
问题 I created an aar and i added it to my project as an module. in this module i have a HelloWorldActivity that i want to run. my module manifest looks like this. <application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > <activity android:name="ir.sibvas.testlibary1.HelloWorldActivity" android:label="@string/app_name" > <intent-filter> <action android:name="ir.sibvas.testlibary1.HelloWorldActivity" /> <category

Permission Denial with File Provider through intent

泪湿孤枕 提交于 2020-02-24 07:49:37
问题 I am attempting send a bitmap from the cache directory of my app to the text messaging app. I am using file provider to grant temporary permission to the application that handles the intent. When I try to send the intent and I select the default android text messaging app from the intent chooser my message app crashes and I get this error. I tried selecting other applications from the intent chooser such as email and other messaging apps and it seemed to work fine, only crashes with the

Start intent after Reboot

怎甘沉沦 提交于 2020-02-23 06:13:15
问题 I have a GPS Service that gets GPS position every 60 seconds. It's working okay, but it doesn't do anything after phone reboot. I tried adding this in a BroadcastReceiver that is working after reboot but nothing happens. Any help would be great; I just need to load my Intents after reboot. //Start intents after reboot if (intent.getAction().equals("android.intent.action.BOOT_COMPLETED")) { context.startService(new Intent(context, DashboardActivity.class)); } GPSActivity.java public int

Start intent after Reboot

China☆狼群 提交于 2020-02-23 06:13:10
问题 I have a GPS Service that gets GPS position every 60 seconds. It's working okay, but it doesn't do anything after phone reboot. I tried adding this in a BroadcastReceiver that is working after reboot but nothing happens. Any help would be great; I just need to load my Intents after reboot. //Start intents after reboot if (intent.getAction().equals("android.intent.action.BOOT_COMPLETED")) { context.startService(new Intent(context, DashboardActivity.class)); } GPSActivity.java public int