Skip to main content

Posts

Showing posts with the label Timer Thread Example in Android

Thread Example in ANDROID -- Timer Thread Example

See more post on threads : Non Runnable States in Multithreading W hat is thread in java ? This example shows how a thread get activated on every interval of time. Here an array of string is given which is used to display a text change for every activated thread calls. public class Threadexample extends Activity { protected int splashTime = 3000; TextView tv1; String[] name = {"Angel","Mark","Coding","Playground","For","All","Coderz"}; int timer =0; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_threadexample); tv1 = (TextView) findViewById(R.id.textView1); Thread th=new Thread(){ @Override public void run(){ try { for (timer =...