Back to project page SpeechWriter.
The source code is released under:
MIT License
If you think the Android project SpeechWriter listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package edu.psu.rcy5017.speechwriter.task; //from w w w . j ava2s . c o m import edu.psu.rcy5017.speechwriter.datasource.DataSource; import android.os.AsyncTask; /** * A task that updates the order of the elements from a particular table corresponding to a Datasource. * @author Ryan Yosua * * @param <E> The type of the element that your task will update. This will be one of the types from the model package. */ public class UpdateOrderTask<E> extends AsyncTask<Void, Void, Integer> { private final DataSource<E> datasource; private final E elementToUpdate; private final int newOrder; public UpdateOrderTask(DataSource<E> datasource, E elementToUpdate, int newOrder) { this.datasource = datasource; this.elementToUpdate = elementToUpdate; this.newOrder = newOrder; } @Override protected Integer doInBackground(Void... params) { datasource.open(); final Integer rowsAffected = datasource.ubdateOrder(elementToUpdate, newOrder); datasource.close(); return rowsAffected; } }