๊ฐœ๋ฐœ/Android

[Android] MediaBrowser.connect() ์•„๋ฌด ๋ฐ˜์‘์ด ์—†์„ ๋•Œ

๋„๋ฆฌ ๐ŸŸ 2021. 4. 9. 00:30

์ž‘์„ฑ์ผ: 2020.02.13


MediaBrowser.connect() ํ˜ธ์ถœํ•ด๋„ ์•„๋ฌด ๋ฐ˜์‘์ด ์—†์„ ๋•Œ ํ•ด๊ฒฐ ๋ฐฉ๋ฒ•

์ด์Šˆ ๋‚ด์šฉ

MediaBrowser.connect()๋ฅผ ํ˜ธ์ถœํ•˜๊ณ  ์—ฐ๊ฒฐ์„ ์‹œ๋„ํ•œ๋‹ค๋Š” ์•„๋ž˜ ๋กœ๊ทธ๊นŒ์ง€๋Š” ์ถœ๋ ฅ๋จ

D/MediaBrowserCompat: Connecting to a MediaBrowserService.

MediaBrowser๋Š” ์—ฐ๊ฒฐ ์ƒํƒœ์— ๋Œ€ํ•ด onConncected / onConnectionFailed / onConnectionSuspended ๋ผ๋Š” ์„ธ ๊ฐ€์ง€ ์ฝœ๋ฐฑ๋„ ์ œ๊ณตํ•˜๊ณ  ์žˆ๋‹ค. ์ด๋ฒˆ ์ด์Šˆ์˜ ๊ฒฝ์šฐ ์—ฐ๊ฒฐ ์‹œ๋„ ์ดํ›„์— ์•„๋ฌด ์ฝœ๋ฐฑ๋„ ํ˜ธ์ถœ๋˜์ง€ ์•Š์•˜๋‹ค.

์›์ธ

๊ธฐ์กด์— Service๋ฅผ ์ƒ์†๋ฐ›๋˜ ๊ฑธ MediaBrowserService ์ƒ์†์œผ๋กœ ๋ณ€๊ฒฝํ•˜๋ฉด์„œ onBind๋ฅผ ์žฌ์ •์˜ํ•œ ๋ถ€๋ถ„์„ ๋‚จ๊ฒจ๋‘” ๊ฒƒ์ด ์›์ธ์ด์—ˆ๋‹ค.๐Ÿคฆ๐Ÿป‍โ™€๏ธ MediaBrowserService๋Š” ๋‚ด๋ถ€์ ์œผ๋กœ onBind๋ฅผ ๊ตฌํ˜„ํ•˜๊ณ  ์žˆ๊ธฐ ๋•Œ๋ฌธ์—, ์•„๋ž˜ ์ฝ”๋“œ๋ฅผ ์‚ญ์ œํ•˜๋‹ˆ ์ •์ƒ์ ์œผ๋กœ ์—ฐ๊ฒฐ๋˜์—ˆ๋‹ค.

//์ œ๊ฑฐ!
@Override
public IBinder onBind(Intent intent) {
    return null;
}