@@ -0,0 +1,3390 @@
+package org.qiaoer.photogallery;%0A%0Aimport android.app.IntentService;%0Aimport android.content.Intent;%0Aimport android.content.Context;%0A%0A/**%0A * An %7B@link IntentService%7D subclass for handling asynchronous task requests in%0A * a service on a separate handler thread.%0A * %3Cp%3E%0A * TODO: Customize class - update intent actions, extra parameters and static%0A * helper methods.%0A */%0Apublic class PollService extends IntentService %7B%0A    // TODO: Rename actions, choose action names that describe tasks that this%0A    // IntentService can perform, e.g. ACTION_FETCH_NEW_ITEMS%0A    private static final String ACTION_FOO = %22org.qiaoer.photogallery.action.FOO%22;%0A    private static final String ACTION_BAZ = %22org.qiaoer.photogallery.action.BAZ%22;%0A%0A    // TODO: Rename parameters%0A    private static final String EXTRA_PARAM1 = %22org.qiaoer.photogallery.extra.PARAM1%22;%0A    private static final String EXTRA_PARAM2 = %22org.qiaoer.photogallery.extra.PARAM2%22;%0A%0A    /**%0A     * Starts this service to perform action Foo with the given parameters. If%0A     * the service is already performing a task this action will be queued.%0A     *%0A     * @see IntentService%0A     */%0A    // TODO: Customize helper method%0A    public static void startActionFoo(Context context, String param1, String param2) %7B%0A        Intent intent = new Intent(context, PollService.class);%0A        intent.setAction(ACTION_FOO);%0A        intent.putExtra(EXTRA_PARAM1, param1);%0A        intent.putExtra(EXTRA_PARAM2, param2);%0A        context.startService(intent);%0A    %7D%0A%0A    /**%0A     * Starts this service to perform action Baz with the given parameters. If%0A     * the service is already performing a task this action will be queued.%0A     *%0A     * @see IntentService%0A     */%0A    // TODO: Customize helper method%0A    public static void startActionBaz(Context context, String param1, String param2) %7B%0A        Intent intent = new Intent(context, PollService.class);%0A        intent.setAction(ACTION_BAZ);%0A        intent.putExtra(EXTRA_PARAM1, param1);%0A        intent.putExtra(EXTRA_PARAM2, param2);%0A        context.startService(intent);%0A    %7D%0A%0A    public PollService() %7B%0A        super(%22PollService%22);%0A    %7D%0A%0A    @Override%0A    protected void onHandleIntent(Intent intent) %7B%0A        if (intent != null) %7B%0A            final String action = intent.getAction();%0A            if (ACTION_FOO.equals(action)) %7B%0A                final String param1 = intent.getStringExtra(EXTRA_PARAM1);%0A                final String param2 = intent.getStringExtra(EXTRA_PARAM2);%0A                handleActionFoo(param1, param2);%0A            %7D else if (ACTION_BAZ.equals(action)) %7B%0A                final String param1 = intent.getStringExtra(EXTRA_PARAM1);%0A                final String param2 = intent.getStringExtra(EXTRA_PARAM2);%0A                handleActionBaz(param1, param2);%0A            %7D%0A        %7D%0A    %7D%0A%0A    /**%0A     * Handle action Foo in the provided background thread with the provided%0A     * parameters.%0A     */%0A    private void handleActionFoo(String param1, String param2) %7B%0A        // TODO: Handle action Foo%0A        throw new UnsupportedOperationException(%22Not yet implemented%22);%0A    %7D%0A%0A    /**%0A     * Handle action Baz in the provided background thread with the provided%0A     * parameters.%0A     */%0A    private void handleActionBaz(String param1, String param2) %7B%0A        // TODO: Handle action Baz%0A        throw new UnsupportedOperationException(%22Not yet implemented%22);%0A    %7D%0A%7D%0A

add service to check update