Note that there are some explanatory texts on larger screens.

plurals
  1. USJop van Raaij
    primarykey
    data
    text
    plurals
    1. This table or related slice is empty.
    1. COI think this answer is valid. However.. Only the `AsyncTask` will have a reference to the instance variable. I do not see a memory leak happing easy. Because `doInBackground()` and `OnPostExecute()` are called synchronously, it's not very probable the JVM is still working on the instance variable when calling `OnPostExcetute()` (if that's even possible).
      singulars
    2. COI think this a base for a great solution. It is important to be able to test all interface methods implemented by an object. But imagine a RepositoryGateway interface with methods like saveUser(user) and findUserById(id), which should be implemented for different databases. For findUserById(id), the testmethod specific setup will need to populate the specific database with the user to be found. For saveUser(user),the assert part should retrieve data from the specific database. Could this be solved by adding a hook (like prepareFindUser) in the testmethod, implemented by the specific testclass?
      singulars
    3. COI'd guess you should use `cancel(boolean)`. This will also skip `onPostExecute()`. When you want to work conditional of the state resulting from the stuff you do in `doInBackgroud()`, you have to provide the state in the parameters (ugly to use the same parameter for two types of information), or set an instance variable like `mSuccess` (this solution I saw in some tutorial).
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload