๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

๋ถ„๋ฅ˜ ์ „์ฒด๋ณด๊ธฐ

(377)
[Java] Collapse 'catch' blocks ์‹œ์ž‘ Lint ๊ฒฝ๊ณ ์— ๋Œ€์‘ํ•˜๋ฉด์„œ ๊ธฐ์กด try - catch ๋ฌธ์—์„œ ๋‹ค๋ฅธ exception๋„ catch ๋ฌธ์— ๋„ฃ๊ฒŒ ๋˜์—ˆ๋‹ค. ๊ทธ๋Ÿฐ๋ฐ IDE์—์„œ Collapse 'catch' blocks ๋ผ๋ฉฐ catch ๋ฌธ์— ๋ฌด์–ธ๊ฐ€ ๋ณ€๊ฒฝ์ด ๊ฐ€๋Šฅํ•˜๋‹ค๋Š” ๊ฒƒ์„ ์•Œ๋ ค์คฌ๋‹ค. IDE์˜ ์ž‘์—… ํ›„ ์—๋Ÿฌ ์ฒ˜๋ฆฌ ๋กœ์ง์ด ๊ฐ™์€ ๋‘ catch ๋ฌธ ๋ธ”๋Ÿญ์„ ํ•˜๋‚˜๋กœ ์“ธ ์ˆ˜ ์žˆ๋‹ค๋Š” ๊ฑธ ์•Œ์•˜๋‹ค. Collapse ์˜๋ฏธ Collapse 'catch' blocks์˜ 'collapse' ์˜๋ฏธ๋ฅผ ์ฐพ์•„๋ดค๋‹ค. https://en.dict.naver.com/#/entry/enko/e0708beb85ad4906a123396e1c971bee ๋„ค์ด๋ฒ„ ์˜์–ด์‚ฌ์ „ ๋ฏธ๊ตญ/์˜๊ตญ์‹ ๋ฐœ์Œ, ์—ฌ๋Ÿฌ ์ข…๋ฅ˜์˜ ์ถœํŒ์‚ฌ ์‚ฌ์ „ ๋œปํ’€์ด, ํ’๋ถ€ํ•œ ์œ ์˜์–ด/๋ฐ˜์˜์–ด, ๋Œ€ํ‘œ์‚ฌ์ „ ์„ค์ • ๊ธฐ๋Šฅ, ์ƒ์„ธ๊ฒ€์ƒ‰ ๊ธฐ๋Šฅ, ์˜์–ด..
[Android][WebView] ์•ฑ๊ณผ WebVeiw ๊ฐ„ ํ†ต์‹  https://developer.android.com/develop/ui/views/layout/webapps/webview Build web apps in WebView | Android Developers If you want to deliver a web application (or just a web page) as a part of a client application, you can do it using WebView. The WebView class is an extension of Android's View class that allows you to display web pages as a part of your activity layout. developer.android.com 1) ..
[์ž๋ฃŒ๊ตฌ์กฐ] ์—ฐ๊ฒฐ ๋ฆฌ์ŠคํŠธ ๋‹จ์ผ ์—ฐ๊ฒฐ ๋ฆฌ์ŠคํŠธ ๋…ธ๋“œ ๊ตฌ์„ฑ : ๋ฐ์ดํ„ฐ + link(๋‹ค์Œ ๋…ธ๋“œ์— ๋Œ€ํ•œ ์—ฐ๊ฒฐ ๊ณ ๋ฆฌ. ํฌ์ธํ„ฐ ํ˜น์€ ๋ ˆํผ๋Ÿฐ์Šค) ์ฒซ ๋ฒˆ ์งธ ๋…ธ๋“œ : ํ—ค๋” header ๋งˆ์ง€๋ง‰ ๋…ธ๋“œ : ๊ผฌ๋ฆฌ tail. link๋Š” ๋น„์›Œ๋‘๊ฑฐ๋‚˜ null๋กœ ์ง€์ •ํ•จ ๋…ธ๋“œ์˜ link๋Š” ๋‹ค์Œ ๋…ธ๋“œ๋ฅผ ๊ฐ€๋ฆฌํ‚ค๋Š” ํฌ์ธํŠธ๋‚˜ ๋ ˆํผ๋Ÿฐ์Šค๋กœ๋งŒ ๊ตฌ์„ฑ๋จ. ๊ทธ๋ž˜์„œ ์•ž์œผ๋กœ๋งŒ ์ข…์ฃผ ๊ฐ€๋Šฅ ๋ฆฌ์ŠคํŠธ๋ฅผ ์™„์ • ์ข…์ฃผํ•˜๋ ค๋ฉด ํ•ญ์ƒ ์ฒซ ๋ฒˆ์งธ ์›์†Œ๋ถ€ํ„ฐ ์‹œ์ž‘ํ•ด์•ผ ํ•œ๋‹ค. ๋ฆฌ์ŠคํŠธ์— ์žˆ๋Š” ๋ชจ๋“  ์›์†Œ์˜ ์œ„์น˜๋ฅผ ํŒŒ์•…ํ•˜๋ ค๋ฉด ๋ฆฌ์ŠคํŠธ์˜ ์ฒซ ๋ฒˆ์งธ ์›์†Œ์— ๋Œ€ํ•œ ํฌ์ธํ„ฐ๋‚˜ ๋ ˆํผ๋Ÿฐ์Šค๊ฐ€ ์žˆ์–ด์•ผ ํ•œ๋‹ค. ์ฒซ ๋ฒˆ์žฌ ์›์†Œ์˜ ํฌ์ธํ„ฐ๋‚˜ ๋ ˆํผ๋Ÿฐ์Šค๋Š” ๋ณดํ†ต ๋ณ„๋„์˜ ์ž๋ฃŒ๊ตฌ์กฐ์— ์ €์žฅํ•จ. ๋…ธ๋“œ. ์ฝ”ํ‹€๋ฆฐ์œผ๋กœ ์ž‘์„ฑ class SinglyLinkedListElement(val value: T, var next: SinglyLinkedListElemen..
[Android][Toast] Can't toast on a thread that has not called Looper.prepare() Crashlytics์—์„œ ์ด์Šˆ ํ•ด๋‹น ๋ฐœ๊ฒฌ ๋งˆ์ด๋„ˆ ์ด์Šˆ๋กœ ๋“ฑ์žฅํ•˜๊ณ  ์žˆ๋‹ค. (๊ณ  ํŒ๋‹จํ•˜๊ณ  ์žˆ๋‹ค. ์ œ๋ฐœ ๋งˆ์ด๋„ˆ ์ด์Šˆ์—ฌ๋ผ...) ์ด์Šˆ์— ๋Œ€ํ•œ ์„ค๋ช…๋“ค https://stackoverflow.com/a/3875204 Can't create handler inside thread that has not called Looper.prepare() What does the following exception mean; how can I fix it? This is the code: Toast toast = Toast.makeText(mContext, "Something", Toast.LENGTH_SHORT); This is the exception: java.lang.RuntimeExce... stackoverflow...
[Kotlin] Calendar extensions ๊ฐ„๋‹จ val Calendar.year: Int get() = this.get(Calendar.YEAR) val Calendar.month: Int get() = this.get(Calendar.MONTH) val Calendar.day: Int get() = this.get(Calendar.DAY_OF_MONTH) val Calendar.dayOfWeek: Int get() = this.get(Calendar.DAY_OF_WEEK)
[Kotlin] Selection Sort ์ง€์ •ํ•œ ์ž๋ฆฌ์— ํƒ์ƒ‰ ๋ฒ”์œ„(๋น„๊ต ๋Œ€์ƒ)์—์„œ ์ฐพ์€ ๋งž๋Š” ๊ฐ’(๊ฐ€์žฅ ์ž‘๊ฑฐ๋‚˜, ๊ฐ€์žฅ ํฌ๊ฑฐ๋‚˜)์„ ์ฐพ์•„ ๋„ฃ๋Š”๋‹ค. ๊ธฐ๋ณธ swap fun ArrayList.swap(firstIndex: Int, secondIndex: Int) { val temp = this[firstIndex] this[firstIndex] = this[secondIndex] this[secondIndex] = temp } Selection Sort fun ArrayList.selectionSort(showLog: Boolean = true) :ArrayList { if (this.size < 2) { println("๋ฐฐ์—ด ํฌ๊ธฐ : ${this.size}. ๋ฐฐ์—ด ๊ทธ๋Œ€๋กœ ๋ฐ˜ํ™˜") return this } for (currentPosition in 0 u..
[Android][Kotlin] ์‚ฌ์šฉ์ž๊ฐ€ ์„ ํƒํ•œ ํƒญ์˜ ๋ฌธ๊ตฌ์— ๋ณผ๋“œ ์ฒ˜๋ฆฌ ๊ธฐ๋ณธ Tab ๋ณผ๋“œ ์ฒ˜๋ฆฌ fun TabLayout.Tab.setBold() = this.view.children.find { it is TextView }?.let { tv -> (tv as TextView).post { tv.setTypeface(null, Typeface.BOLD) } } ๋‹ค๋ฅธ Typeface๋กœ ๊ต์ฒด ๊ฐ€๋Šฅ https://developer.android.com/reference/android/graphics/Typeface#summary Typeface | Android Developers developer.android.com ์„ ํƒ์ง€๊ฐ€ 4๊ฐ€์ง€ ๋ฐ–์— ์—†๊ธฐ๋Š” ํ•˜๋‹ค. ์‚ฌ์šฉ์ž๊ฐ€ ์„ ํƒํ•œ ํƒญ์˜ ๋ฌธ๊ตฌ ๋ณผ๋“œ ์ฒ˜๋ฆฌ fun TabLayout.setSelectedTabBold() = this.addOnTa..
[Kotlin] BaseUseCase abstract class UseCase where Type : Any { abstract suspend operator fun invoke(params: Params): Type? }