Mohamed Lokbani

IFT155

03-02-2025 Android Studio Ladybug Feature Drop | 2024.2.2
29-01-2024 Android Studio Hedgehog | 2023.1.1 Patch 2
25-01-2023 Android Studio Electric Eel | 2022.1.1
04-02-2022 Android Studio Bumblebee | 2021.1.1
02-02-2018 Android Studio 3.0.1

================

Chapitre 05

4. Thread et UI

================

Nous allons corriger le bogue du programme BasicThread2. Nous avons plusieurs faons de le faire. Dans cet exemple, nous allons examiner une de ces solutions.

Nous allons regrouper les deux lignes problmatiques dans un thread que nous allons faire excuter par le thread principal  travers l'appel  "runOnUiThread":

	runOnUiThread (new Runnable () {
		public void run () {
		   	TextView myTextView = findViewById(R.id.myTextView);
			myTextView.setText(R.string.button_clic);
		}
	});


