Perhaps your service is not registered in the manifest. Use adb
logcat, DDMS, or the DDMS perspective in Eclipse to examine LogCat and
see if there are any relevant messages.

On Tue, May 15, 2012 at 3:54 AM, Mr Nice <[email protected]> wrote:
> My code is bellow..
> In BroadcastReceiver i write like this
>
>
> public class BCRDemo extends BroadcastReceiver {
>
>        @Override
>        public void onReceive(Context context, Intent intent) {
>                Intent myIntent=new Intent(context,MyService.class);
>                context.startService(myIntent);
>        }
>
> }
>
>
> In MyService class i write like this.
>
> public class MyService extends Service {
>
>        @Override
>        public IBinder onBind(Intent intent) {
>                return null;
>        }
>        @Override
>        public int onStartCommand(Intent intent, int flags, int startId){
>                super.onStartCommand(intent, flags, startId);
>                Toast.makeText(getBaseContext(), " Demo Service Started",
> Toast.LENGTH_SHORT).show();
>                return START_STICKY;
>                }
> }
>
>
> And also i register service and broadcast receiver in manifest file..
> but my problem is i am not able to see the toast and it is not visible
> in  Emulator Running Service
>
> --
> 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



-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android Training...At Your Office: http://commonsware.com/training

-- 
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

Reply via email to