Notice
Recent Posts
Recent Comments
Link
ยซ   2025/05   ยป
์ผ ์›” ํ™” ์ˆ˜ ๋ชฉ ๊ธˆ ํ† 
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
Tags
more
Archives
Today
Total
๊ด€๋ฆฌ ๋ฉ”๋‰ด

๐ŸŒฑ dreaming DiNO

[Kotlin] SharedPrefMgr - ๊ฒ€์ƒ‰๊ธฐ๋ก ์‚ญ์ œ, ๋ฆฌ์‚ฌ์ดํด๋Ÿฌ๋ทฐ data ๊ฐฑ์‹  ๋ณธ๋ฌธ

Android

[Kotlin] SharedPrefMgr - ๊ฒ€์ƒ‰๊ธฐ๋ก ์‚ญ์ œ, ๋ฆฌ์‚ฌ์ดํด๋Ÿฌ๋ทฐ data ๊ฐฑ์‹ 

MK_____ 2021. 12. 16. 11:24

 

 

//์ œ๊ฑฐํ•œ ์ƒˆ๋กœ์šด SearchHistroyList
            storedSearchHistoryList.removeAt(index)
            Log.d(TAG, "Shared - ์ œ๊ฑฐํ•œ ์ƒˆ๋กœ์šด list: $storedSearchHistoryList")
//            // K,V ํ˜•์‹์œผ๋กœ ์ €์žฅ๋˜์–ด ์žˆ์œผ๋‹ˆ ๋™์ผํ•œ K์— item์ด ํ•˜๋‚˜ ์‚ญ์ œ๋˜์–ด ์—…๋ฐ์ดํŠธ๋œ araryList๋ฅผ ๋‹ค์‹œ ์ €์žฅ

            storeSearchHistoryList(storedSearchHistoryList)

            Log.d(TAG, "์‚ญ์ œํ›„ listSize : ${storedSearchHistoryList?.size}")

 

SharedPrefMgr์—์„œ arrayList์—์„œ ํ•ด๋‹น index ๊ฐ’์„ ์‚ญ์ œํ•˜๊ณ  ์‹ถ์—ˆ๋Š”๋ฐ ๊ณ„์† return๊ฐ’๋งŒ ๋‚˜์™€์„œ ๋™๋™๋Œ”๋Š”๋ฐ

์ด๋ฏธ ์‚ญ์ œํ•ด์„œ ๊ทธ ์ž์ฒด๊ฐ€ ๋ณ€๊ฒฝ๋œ arrayList๊ฐ€ ๋˜์—ˆ๋‹ค..;; ๐Ÿ˜