You might want to add the following line before making the call callIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
Make sure the you understand the usage of the flag correctly. Find more information about this at http://developer.android.com/reference/android/content/Intent.html#FLAG_ACTIVITY_NEW_TASK -- Roman Baumgaertner Sr. SW Engineer-OSDC ·T· · ·Mobile· stick together The views, opinions and statements in this email are those of the author solely in their individual capacity, and do not necessarily represent those of T-Mobile USA, Inc. On Aug 5, 8:13 pm, gandor <[email protected]> wrote: > How do I call an Activity from a Service > Want to call with a number but the service crashes at startActivity > (callIntent); > I have already added proper permissions for making call in manifest > file > > // services onstart > @Override > public > void onStart(Intent intent, int startId) { > int i; > > for(i= 0; i< 10; i++) > { > Log.i(TAG, "++++++++onStart() is called"+i); > } > > Intent callIntent = new Intent(Intent.ACTION_CALL); > callIntent.setData(Uri.parse("tel:**XXX*+XXXXXXXXXXX" > + encodedHash)); > startActivity(callIntent); > > } > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Beginners" 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-beginners?hl=en -~----------~----~----~----~------~----~------~--~---

