activity_main.xml MyAsyncTask.kt package com.jwsoft.kotlinproject import android.os.AsyncTask import android.widget.TextView import java.lang.Exception class MyAsyncTask(var tvText: TextView) : AsyncTask() { override fun onPreExecute() { super.onPreExecute() } override fun doInBackground(vararg params: Void?): Boolean { for (i in 1..50) { try { Thread.sleep(5) } catch (e: Exception) { e.printSta..
activity_main.xml android:textAllCaps="false" 대소문자 구분 (CHANGE -> Change) MainActivity.kt package com.jwsoft.kotlinproject import androidx.appcompat.app.AppCompatActivity import android.os.Bundle import kotlinx.android.synthetic.main.activity_main.* class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.l..
build.gradle (Module: app) dependencies { // Retrofit2 implementation 'com.squareup.retrofit2:retrofit:2.7.1' implementation 'com.squareup.retrofit2:converter-gson:2.7.1' implementation 'com.squareup.okhttp3:logging-interceptor:4.3.1' } AndroidManifast.xml 인터넷 권한 추가. RetrofitAPI.kt package com.jwsoft.kotlinproject import com.google.gson.JsonObject import retrofit2.Call import retrofit2.http.GET ..
activity_main.xml MainActivity.kt package com.jwsoft.kotlinproject import androidx.appcompat.app.AppCompatActivity import android.os.Bundle import kotlinx.android.synthetic.main.activity_main.* class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) btnChange.setOnClickListener { Thr..
UI 작업은 Main Thread에서 해야 하는데 만약 Worker Thread에서 UI 변경을 해야 한다면 Handler를 이용하여 Main Thread와 연결해 주어야 한다. 단, Handler는 Main Thread에서 생성이 되어야 한다. activity_main.xml MainActivity.kt package com.jwsoft.kotlinproject import androidx.appcompat.app.AppCompatActivity import android.os.Bundle import android.os.Handler import android.os.Message import kotlinx.android.synthetic.main.activity_main.* class MainActi..
- Total
- Today
- Yesterday
- Design Pattern
- JSONObject
- Intent
- TabLayout
- Architecture Pattern
- coroutine
- Vue.js #Vue.js + javascript
- Livedata
- CoordinatorLayout
- ViewPager2
- James Kim
- Android
- 자바
- 안드로이드
- DataBinding
- ViewModel
- XML
- 코틀린
- Kotlin
- ArrayList
- activity
- java
- View
- fragment
- 혀가 길지 않은 개발자
- recyclerview
- handler
- MVVM
- JSONArray
- 안드로이드 #코틀린 #Android #Kotlin
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 31 |