The service is only started once unless the system has to kill the
process to reclaim memory.  You have to call startService() or
bindService() to start the service.  The API docs for
android.app.Service answer all these questions.

On Nov 13, 5:13 am, Shrenik Vikam <[email protected]> wrote:
> how to check that the service with some name is running once ?
>
> also if i go out from my activity then my service is running &
> when i come to my activity the onCreate method is called
> so my service is created again in this case or running service will be
> attached again ???
>
> public class ServiceExampleActivity extends Activity {
>         Intent intent;
>         Button start,stop;
>         @Override
>         protected void onCreate(Bundle savedInstanceState) {
>                 super.onCreate(savedInstanceState);
>                 setContentView(R.layout.main);
>                 intent = new Intent(this, ServiceExample.class);        // 
> service
> example is service class
>                 Log.i("-----service------", "Service  Created");
>         }
>
> }

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