In Java, Runnable cannot "return" a value.
On Android, specifically the best way to deal with your type of script is AsyncTask . This is a generic class so that you can specify the type you want to pass and the type returned by the onPostExecute function.
In your case, you will create AsyncTask<Editable, Void, TypeToReturn>
. Sort of:
private class YourAsyncTask extends AsyncTask<Editable, Void, Integer> { protected Long doInBackground(Editable... params) { Editable editable = params[0];
source share