본문 바로가기

Android90

Javascript Interface 사용 방법 // onCreate()에 WebView wv; wv = findViewById(R.id.webView1); String tempUrl = "file:///android_asset/inedx.html" ; wv.loadUrl(tempUrl); wv.getSettings().setJavaScriptEnabled(true); wv.addJavascriptInterface(new JavascriptInterface(), "SampleAction"); public class JavascriptInterface{ @android.webkit.JavascriptInterface public void doAction(String message) { // Do something } } 2021. 5. 7.
Asset 폴더 만들기 왼쪽에서 app => New => Folder => Assets 하면 생김 이때 HTML 파일이 Asset에 있다고 했을 때 접근 방법 WebView wv; wv = findViewById(R.id.webView1); String tempUrl = "file:///android_asset/inedx.html" ; wv.loadUrl(tempUrl); 2021. 5. 7.
Dialog를 띄울 때 is your activity running이 뜰 때 개발하다보면 Dialog를 띄울때가 있다. 근데 is your activity running? 이러면서 안될때가 있는데 이때 문제는 getApplicationContext() 나 this를 써서 그렇다. 이걸 MainActivity.this를 쓰면 Dialog가 잘 뜬다. XXDialog dialog = new XXDialog(MainActivity.this); dialog.show(); [ Android / Kotlin ] AlertDialog 오류 : Unable to add window -- token null is not valid; is your activity running? (tistory.com) [ Android / Kotlin ] AlertDialog 오류 : Unable to add .. 2021. 5. 4.
Bottom Navigation View에서 애니메이션 없애기 android - How to remove all animation of BottomNavigationView without Helper? - Stack Overflow How to remove all animation of BottomNavigationView without Helper? How to remove all animation of BottomNavigationView without any Helper or proGuard and in easy way with google material dependency com.google.android.material:material:1.0.0? stackoverflow.com 이 글을 참고하면 Animation을 disable 할 수 있다. dimen.. 2021. 5. 3.