lwc:programming:mobile:android:runnable

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
lwc:programming:mobile:android:runnable [2022/02/23 15:28] – created John Harrisonlwc:programming:mobile:android:runnable [2022/02/23 15:31] (current) John Harrison
Line 5: Line 5:
  
     public void run(){     public void run(){
-       System.out.println("MyRunnable running");+       Log.v("MyRunnable running");
     }     }
   }   }
 </code> </code>
-The interface takes no parameters and returns no parameters.+The interface takes no parameters and returns no parameters. When started it will run whatever magical stuff you put in the ''run'' method. Besides the run method you can have a constructor if the spirit moves you.
  
 You can create a runnable so you have something to send on a separate thread. You don't need a runnable to do it, it's just standard convention everybody seems to have agreed upon. You can create a runnable so you have something to send on a separate thread. You don't need a runnable to do it, it's just standard convention everybody seems to have agreed upon.
Line 40: Line 40:
 </code> </code>
  
-//Borrowed and reworded from [[http://tutorials.jenkov.com/java-concurrency/creating-and-starting-threads.html|here]].//+//Borrowed and reworded from [[http://tutorials.jenkov.com/java-concurrency/creating-and-starting-threads.html|this excellent resource]].//
  
  • lwc/programming/mobile/android/runnable.1645651715.txt.gz
  • Last modified: 2022/02/23 15:28
  • by John Harrison