thedesolatesoul Expert Licensed User Longtime User Sep 24, 2012 #1 May I ask what the difference between these two methods to start an intent is? StartActivity seems to be able to start intents in other processes, so they look similar to me.
May I ask what the difference between these two methods to start an intent is? StartActivity seems to be able to start intents in other processes, so they look similar to me.
Erel B4X founder Staff member Licensed User Longtime User Sep 24, 2012 #2 There are three types of intents. Intents that start activities, intents that start services and intents that are intercepted by broadcast receivers. Depending on the target, you should use the correct "sending" method. Upvote 0
There are three types of intents. Intents that start activities, intents that start services and intents that are intercepted by broadcast receivers. Depending on the target, you should use the correct "sending" method.
thedesolatesoul Expert Licensed User Longtime User Sep 24, 2012 #3 Erel said: There are three types of intents. Intents that start activities, intents that start services and intents that are intercepted by broadcast receivers. Depending on the target, you should use the correct "sending" method. Click to expand... I see. I used to think that StartActivity also broadcasts the intent and the OS checks for each intent filter and activates the (first) activity it finds. However, that was wrong and StartActivity only sends the intent to the correct package/application activity and does not broadcast for everyone to listen. SendBroadcastIntent on the other hand broadcasts the intent for any/all apps to see therefore sensitive information should not be broadcast. Upvote 0
Erel said: There are three types of intents. Intents that start activities, intents that start services and intents that are intercepted by broadcast receivers. Depending on the target, you should use the correct "sending" method. Click to expand... I see. I used to think that StartActivity also broadcasts the intent and the OS checks for each intent filter and activates the (first) activity it finds. However, that was wrong and StartActivity only sends the intent to the correct package/application activity and does not broadcast for everyone to listen. SendBroadcastIntent on the other hand broadcasts the intent for any/all apps to see therefore sensitive information should not be broadcast.
Erel B4X founder Staff member Licensed User Longtime User Sep 25, 2012 #4 That is not 100% accurate. You can use StartActivity to start an unknown app. Only if you call Intent.SetComponent, you explicitly set the app that will handle the intent (when you call StartActivity with one of your activities then the component is also set). Upvote 0
That is not 100% accurate. You can use StartActivity to start an unknown app. Only if you call Intent.SetComponent, you explicitly set the app that will handle the intent (when you call StartActivity with one of your activities then the component is also set).
thedesolatesoul Expert Licensed User Longtime User Sep 25, 2012 #5 I tried to use setcomponent, but it did not work for me. Maybe there was something i needed to set in the manifest or elsewhere? Upvote 0
I tried to use setcomponent, but it did not work for me. Maybe there was something i needed to set in the manifest or elsewhere?
Erel B4X founder Staff member Licensed User Longtime User Sep 26, 2012 #6 You need to post more information. What are you trying to start? How are you building the intent? Does it run in a different process? Upvote 0
You need to post more information. What are you trying to start? How are you building the intent? Does it run in a different process?