相关疑难解决方法(0)

在Android中启动服务

我想在某个活动开始时调用服务.那么,这是Service类:

public class UpdaterServiceManager extends Service {

    private final int UPDATE_INTERVAL = 60 * 1000;
    private Timer timer = new Timer();
    private static final int NOTIFICATION_EX = 1;
    private NotificationManager notificationManager;

    public UpdaterServiceManager() {}

    @Override
    public IBinder onBind(Intent intent) {
        // TODO Auto-generated method stub
        return null;
    }

    @Override
    public void onCreate() {
        // Code to execute when the service is first created
    }

    @Override
    public void onDestroy() {
        if (timer != null) {
            timer.cancel();
        }
    }

    @Override
    public int …
Run Code Online (Sandbox Code Playgroud)

service android android-activity

112
推荐指数
3
解决办法
27万
查看次数

标签 统计

android ×1

android-activity ×1

service ×1