Android/깡샘_코틀린
-
buildFeatures ErrorAndroid/깡샘_코틀린 2021. 11. 29. 09:39
buildFeatures { viewBinding = true } 자동 코드완성기능을 사용할시 buildFeatures( viewBinding = true ) 중괄호가 아닌 소괄호로 묶여서 sync Error 발생 Cannot set the value of read-only property 'viewBinding' for extension 'android' of type com.android.build.gradle.internal.dsl.BaseAppModuleExtension
-
SystemClockAndroid/깡샘_코틀린 2021. 11. 4. 17:46
Android는 다음과 같이 현재 시간, 경과 시간을 가져오는 API를 제공합니다. System.currentTimeMillis() SystemClock.elapsedRealtime() SystemClock.uptimeMillis() 각각의 API를 소개하고 차이점에 대해서 알아보겠습니다. System.currentTimeMillis() 현재 시각을 UTC(1970년 1월 1일이 0인 시간)의 millisecond로 리턴합니다. 디바이스에 설정된 현재 시각을 기준으로 리턴하기 때문에, 네트워크가 연결되어 시각이 변경되거나 위도(Time zone)가 변경되어 UTC가 변경될 수 있습니다. 그렇기 때문에, 시간의 차이를 계산할 때 적합하지 않습니다. 물론 짧은 간격으로 사용한다면 문제가 될 가능성이 거의 없..
-
07-3 binding syntax errorAndroid/깡샘_코틀린 2021. 11. 4. 14:02
class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) val binding = ActivityMainBinding.inflate(layoutInflater) setContentView(binding.root) binding.button.setOnClickListener { binding.button.visibility = View.INVISIBLE // binding. 추가 binding.imageView.visibility = View.VISIBLE } binding.imageView.setOnClickListener { b..