title: Paint in Android Studio in background
body: <p>Im trying to develop an App in android Studio and I want to use <code>Paint</code> and <code>Canvas</code>, basically paint something,  when I use <code>publishProgress</code>.</p>
  
  <p>It would be great if any of you could tell me what is wrong with my code and why this is not painting anything.</p>
  
  <p>Note. This all is in a <code>AsyncTaskActivity</code> class</p>
  
  <pre><code> @Override
      protected void doInBackground(Void... params) {
  
               publishProgress(); // Run onProgressUpdate() method
           }
  
      }
  
   @Override
      protected void onProgressUpdate(Void... params) {
          // Here you can access the UI thread
          Canvas canvas = new Canvas();
          Paint pa1= new Paint();
          pa1.setColor(Color.RED);
          pa1.setStyle(Paint.Style.FILL);
          pa1.setStrokeWidth(50);
  
          canvas.drawLine(0, 0, 100, 100, pa1);
      }
  </code></pre>