🌱 dreaming DiNO
[Kotlin] Webview Header추가하여 loadUrl 하기, 새창 막기 본문
@SuppressLint("SetJavaScriptEnabled")
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
BleDebugLog.i(logTag, "onViewCreated-()")
val headers = HashMap<String, String>()
headers["Authorization"] = App.prefs.getString("token", "no token")
binding.webView.apply {
loadUrl("$BASE_URL/test/activityListWebView", headers)
webViewClient = WebViewClient() // 새창 막기
}
}
'Android > Android Studio' 카테고리의 다른 글
[Kotlin] Scoped Storage(범위지정 저장소) 정리 (Legacy Storage와 차이점 정리) (1) | 2023.05.19 |
---|---|
[Kotlin] 연결한 Webview url 화면이 모바일 크기에 안맞고 확대해서 보일때 (0) | 2023.03.22 |
[Kotlin] [에러해결] Retrofit (레트로핏) post 방식 Content-Type 확인 (1) | 2023.03.16 |
[Kotlin] arrayList에 담긴 특정 값 만 return 하기 -> .find() (0) | 2023.03.10 |
[Kotlin] arrayList<CSVData> 에서 파일 이름이 같으면 삭제하기 (0) | 2023.03.08 |