I am developing one application in that when user call on 000 then one
message will be sent to predefined number. But my application is not
working. My code is like this
Manifest.xml contains
<receiver android:name="MyLogReceiver">
<intent-filter>
<action
android:name="android.intent.action.ACTION_NEW_OUTGOING_CALL" />
</intent-filter>
</receiver>
MyLogReceiver contains
public void onReceive(Context context, Intent intent)
{
Intent myStarterIntent = new Intent(context,MicroERS2.class);
myStarterIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(myStarterIntent);
}
and MicroERS2 contains
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
sendSMS("9960510915","Hi Pramod");
}
public void sendSMS(String number, String massage)
{
//actual code
}
But when I press call button message will not sent to that predefined
number. and when I change in Manifest.xml as
<action android:name="android.intent.action.CAMERA_BUTTON" />
instead of
<action
android:name="android.intent.action.ACTION_NEW_OUTGOING_CALL" />
then message will be sent. Why this is so?
Please help me.
Thanks in advance
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en