title: Is a good practice create anonymous AsyncTask for parallel small known freeze process?
body: <p>E.g.: you gonna do something that will take a few seconds and don't wanna freeze your UI thred, right? You could use an AsyncTask but you don't wanna create a external (or inner) class to solve a small freeze problem.</p>
  
  <p>So, is a good pratice do it?</p>
  
  <pre><code>package com.example.stackoverflowsandbox;
  
  import android.os.AsyncTask;
  
  public class Foo {
      // E.g. before call foo method you change you Activity to loading state.
      private void foo() {
          new AsyncTask&lt;Void, Void, Void&gt;() {
              @Override
              protected Void doInBackground( final Void ... params ) {
                  // something you know that will take a few seconds
  
                  return null;
              }
  
              @Override
              protected void onPostExecute( final Void result ) {
                  // continue what you are doing...
  
                  Foo.this.continueSomething();
              }
          }.execute();
      }
  
      private void continueSomething() {
          // some code...
      }
  }
  </code></pre>
  
  <p>I've faced with that when I compressing Bitmaps and looping big array to update some data inside items.</p>