본문 바로가기

전체 글310

안드로이드] Error inflating class com.google.android.material.tabs.TabLayout https://github.com/material-components/material-components-android/issues/340 Error inflating class com.google.android.material.tabs.TabLayout happens on Samsung Galaxy S3 - API 18 · Issue #340 · material Error inflating class com.google.android.material.tabs.TabLayout at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2295) at android.app.ActivityThread.handleLaunchActivity.. 2021. 10. 7.
안드로이드] ViewPager PageIndicatorView PageIndicatorView - Sample Code and Directory of libraries for Android Developers - AndroidHiro.com PageIndicatorView will simplify your life while you working with Android ViewPager and need to indicate selected page. It's easy to setup and customize as you need with run-time preview rendering.PageIndicatorView will simplify your life while you working androidhiro.com .. private var dots: PageI.. 2021. 9. 29.
67] kotlin 프로그래머스/ 행렬의 덧셈 class Solution { fun solution(arr1: Array, arr2: Array): Array { var answer = Array(arr1.size){i -> IntArray(arr1[i].size) } for (i in arr1.indices){ var array = IntArray(arr1[i].size) for(j in arr1[i].indices){ array[j] = arr1[i][j] + arr2[i][j] } answer[i] = array } return answer } } 아 배열 초기화 그지같네,, class Solution { fun solution(arr1: Array, arr2: Array): Array { var answer = Array(arr1.size){.. 2021. 9. 29.
66] Kotlin 프로그래머스 / x만큼 간격이 있는 n개의 숫자 class Solution { fun solution(x: Int, n: Int): LongArray { // n 크기의 배열 선언 val answer = LongArray(n) for (i in 0 until n) { // 둘다 가능 answer[i] = (i + 1) * x.toLong() // answer.set(i, ((i+1) * x.toLong()) } return answer } } 코틀린으로 알고리즘 풀려니 헷갈려,, class Solution { fun solution(x: Int, n: Int): LongArray { // n 크기의 배열 선언 val answer = LongArray(n){i-> x.toLong() * (i + 1).toLong() } return answer } } .. 2021. 9. 28.
65] Kotlin 프로그래머스 음양 더하기 class Solution { fun solution(absolutes: IntArray, signs: BooleanArray): Int { var answer: Int = 0 for(i in 0 until absolutes.size){ if(signs[i]){ answer += absolutes[i] }else{ answer -= absolutes[i] } } return answer } } 2021. 9. 28.
Android] recyclerview notifydatasetChanged 안될때 fun fff(list: JSONArray){ menuItems.clear() menuItems.add(("A")) menuItems.add(("B")) menuItems.add(("C")) adapter!!.notifyDataSetChanged() recyclerView!!.adapter = adapter } 😈😈😈 adapter!!.notifyDataSetChanged() recyclerView!!.adapter = adapter 안드로이드 ListView에 데이터 추가 또는 변경 시 갱신(Update)하기. ListView에서 데이터를 추가 또는 변경이 되었을 떄 ListView를 갱신(Update)하는 방법입니다. 그런데 주의해야 할 점은 안드로이드의 화면이 Activity를 상속받았는지 아니면 .. 2021. 9. 24.