티스토리 뷰
JamesThread.java
package com.jwsoft.javaproject;
import android.util.Log;
public class JamesThread extends Thread {
@Override
public void run() {
super.run();
Log.e("NickName : ", "혀가 길지 않은 개발자");
showLastName();
showFirstName();
}
public void showLastName() {
Log.e("LastName : ", "Kim");
}
public void showFirstName() {
Log.e("FirstName : ", "James");
}
}
MainActivity.java
package com.jwsoft.javaproject;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Log.e("", "Thread START");
JamesThread jamesThread = new JamesThread();
jamesThread.start();
Log.e("", "Thread END");
}
}
MainActivity.java
package com.jwsoft.javaproject;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Log.e("", "Thread START");
JamesThread jamesThread = new JamesThread();
jamesThread.start();
try {
jamesThread.join();
} catch (InterruptedException e) {
e.printStackTrace();
}
Log.e("", "Thread END");
}
}
jamesThread.join() 추가
'Android > Java' 카테고리의 다른 글
[Java] import com.google.gson.* (0) | 2020.07.31 |
---|---|
[Java] import org.json.* (0) | 2020.07.30 |
[Java] Synchronized (0) | 2020.07.27 |
[Java] Generics (0) | 2020.07.24 |
[Java] MVVM (0) | 2020.07.23 |
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- JSONArray
- Android
- TabLayout
- Intent
- fragment
- 자바
- DataBinding
- Kotlin
- 코틀린
- ViewPager2
- MVVM
- Livedata
- CoordinatorLayout
- ViewModel
- handler
- recyclerview
- coroutine
- View
- 안드로이드
- Vue.js #Vue.js + javascript
- James Kim
- XML
- Architecture Pattern
- Design Pattern
- 안드로이드 #코틀린 #Android #Kotlin
- 혀가 길지 않은 개발자
- ArrayList
- java
- JSONObject
- activity
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
글 보관함