Well, I've written an application that starts by dialing an specific number, I have used NEW_OUTGOING_CALL(a broad cast receiver) to catch the dial event. So far the broad cast receiver on my AndroidManifest.xml is like the following code:
<receiver android:name=".CustomBroadCastReceiver">
<intent-filter>
<action android:name="android.intent.action.NEW_OUTGOING_CALL" />
</intent-filter>
</receiver>
The problem is that when I try it on a new system, it doesn't work at first , But after a few times testing, it starts working. I have checked the android logs and think it doesn't even register as a broadcast receiver. I couldn't find a reason for this behavior in Android reference, And want to know if anybody had the same problem and found solution for it,
Please consider that this broad cast receiver is suppose to be the starting trigger of my application
I have also read something about stopped packages, And I want to know if it is related to my case, And if it is, is there a way to set flags such as FLAG_INCLUDE_STOPPED_PACKAGES on AndroidManifest.xml
======Edited======
After I call the following command for the first time on adb shell
am broadcast -n com.package.name/.StartApp
This line appears on the Emulator's log
06-15 11:17:53.216: INFO/ActivityManager(74): Start proc com.package.name for broadcast com.package.name/.StartApp: pid=2153 uid=10041 gids={3003}
And then the broad cast receiver get registered on the Emulator, Looks like my application needs to be started in order to register the broad cast receiver