android-intent

Android receiver ignore NEW_OUTGOING_CALL

独自空忆成欢 提交于 2021-02-10 14:14:24
问题 I have a with Broadcastreceiver with an intent-filter to catch android.intent.action.NEW_OUTGOING_CALL. I read many tutorials and answer here about handling NEW_OUTGOING_CALL intent, but I was unable to make this thing works. My goal is to log intent android.intent.action.NEW_OUTGOING_CALL received by my Broadcastreceiver. I'm unable to make this simple thing works. Here's my code: Manifest.xml <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res

Difference between calling getActivity().startActivity(); and startActivity(); inside Fragment

眉间皱痕 提交于 2021-02-10 09:53:27
问题 start Activity from inside a Fragment can be done with both codes : startActivity(Intent); getActivity().startActivity(); what is the difference ?? Note : I know the difference when it becomes to startActivityForResult(); so please don't post any thing relates to this method. Thanks 回答1: Nothing. The Fragment docs are pretty clear on this: public void startActivity (Intent intent) Call startActivity(Intent) from the fragment's containing Activity. 回答2: The biggest difference: Fragment

Launch chat with user in MS Teams Android app from my android app

余生颓废 提交于 2021-02-10 07:14:59
问题 I have an Android app, where a tap on a button should launch Microsoft Teams Android app and open a chat with a pre-defined user. Is it possible to do and if yes - how? 回答1: If you know user's E-Mail with which he/she is registered in MS Teams (ex: username@email.com ), you can directly open chat with him/her using one of two options: show user a chooser sheet with a choice to open chat in MS Teams Android app or one of web browsers: val sendIntent = Intent(Intent.ACTION_VIEW, Uri.parse(

Launch chat with user in MS Teams Android app from my android app

☆樱花仙子☆ 提交于 2021-02-10 07:04:41
问题 I have an Android app, where a tap on a button should launch Microsoft Teams Android app and open a chat with a pre-defined user. Is it possible to do and if yes - how? 回答1: If you know user's E-Mail with which he/she is registered in MS Teams (ex: username@email.com ), you can directly open chat with him/her using one of two options: show user a chooser sheet with a choice to open chat in MS Teams Android app or one of web browsers: val sendIntent = Intent(Intent.ACTION_VIEW, Uri.parse(

Launch chat with user in MS Teams Android app from my android app

岁酱吖の 提交于 2021-02-10 07:03:37
问题 I have an Android app, where a tap on a button should launch Microsoft Teams Android app and open a chat with a pre-defined user. Is it possible to do and if yes - how? 回答1: If you know user's E-Mail with which he/she is registered in MS Teams (ex: username@email.com ), you can directly open chat with him/her using one of two options: show user a chooser sheet with a choice to open chat in MS Teams Android app or one of web browsers: val sendIntent = Intent(Intent.ACTION_VIEW, Uri.parse(

Sending Extras to onReceive only retrieves ALARM_COUNT

笑着哭i 提交于 2021-02-10 07:03:19
问题 I made a custom view that sets an alarm with AlarmManager. I want to restore this view later so I'm trying to send the BroadcastReceiver several extras. The onReceive fails to retrieve anything but the ALARM_COUNT extra though. I've looked for a while and count find a solution. I've tried PendingIntent.FLAG.UPDATE.CURRENT multiple flags with the intent itself but nothing works. Is there a better way to restore a views state from a BroadcastReceiver? 回答1: "extras are all serialized into a byte

Sending Extras to onReceive only retrieves ALARM_COUNT

感情迁移 提交于 2021-02-10 07:01:21
问题 I made a custom view that sets an alarm with AlarmManager. I want to restore this view later so I'm trying to send the BroadcastReceiver several extras. The onReceive fails to retrieve anything but the ALARM_COUNT extra though. I've looked for a while and count find a solution. I've tried PendingIntent.FLAG.UPDATE.CURRENT multiple flags with the intent itself but nothing works. Is there a better way to restore a views state from a BroadcastReceiver? 回答1: "extras are all serialized into a byte

How can I intercept the Intent when the user open another application?

落爺英雄遲暮 提交于 2021-02-10 04:47:46
问题 Let's say the user open "Settings" application, is there a way to "intercept" this intent, from my app's service, in order to detect that "Settings" app is going to be openned? For instance, in SOTI MobiControl app you can manage (from a web dashboard) the permissions of the user with the app installed (and enrolled to your server). If you don't allow one user to open Settings app, when he tries to open it, a toast appears saying "Unauthorized". How do they that? 回答1: Is there a way to

Android - “setToolbarColor(int)” and “setSecondaryToolbarColor(int)” is deprecated

流过昼夜 提交于 2021-02-09 10:43:45
问题 I use this code to open links with Chrome Custom Tabs. But it's showing @Deprecated for setToolbarColor() and setSecondaryToolbarColor() . I haven't found anything for replacement. Note: Android studio suggests "Use setDefaultColorSchemeParams instead." but haven't found any examples of that. Uri uri = Uri.parse(url); CustomTabsIntent.Builder intentBuilder = new CustomTabsIntent.Builder(); intentBuilder.setToolbarColor(ContextCompat.getColor(activity,R.color.background)); intentBuilder

Android open gallery from folder

匆匆过客 提交于 2021-02-09 02:49:59
问题 I want to show a photo in android gallery, and be able to slide throw the others photos on that folder. Intent intent = new Intent(Intent.ACTION_VIEW); File f = new File(path); intent.setDataAndType(Uri.parse("file://" + f.getAbsolutePath()), "image/*"); mContext.startActivity(intent); thats how i am doing it now, but wont let me slide throw the rest of the images in the folder. i tried: How to open one particular folder from gallery in android? Built-in gallery in specific folder Gallery