본문 바로가기

Android90

<Kotlin 코틀린> 안드로이드 WebView(웹뷰) window.open 새창 처리하기 (옆에 짤림 해결) 자바가 필요하신 분께서는 https://onedaycodeing.tistory.com/62 안드로이드 하이브리드앱 새창 Popup(팝업)창 띄우기 및 닫기 하이브리드 앱을 진행하면서 Webview를 통해 페이지를 띄웁니다. 진행을 하다보면 스크립트(Javascript)딴에서 window.open으로 새창(팝업)을 띄웁니다. 이걸 안드로이드(네이티브)딴에서 뒤로가기나 다 onedaycodeing.tistory.com 이쪽 게시글로 가주세요! lateinit var mContainer : FrameLayout lateinit var mWebView : WebView lateinit var mWebViewPop : WebView lateinit var mWebSettings : WebSettings 우선 이렇.. 2021. 11. 10.
Android 앱 캐시 및 데이터 내가 원하는것만 골라서 삭제해보자. public static void clearApplicationData(Context context) { File cache = context.getCacheDir(); File appDir = new File(cache.getParent()); if (appDir.exists()) { String[] children = appDir.list(); for (String list : children) { Log.d("캐시삭제 ", list); if(list.equals("shared_prefs")) continue; deleteDir(new File(appDir, list)); } } } private static boolean deleteDir(File dir) { if (dir != null && di.. 2021. 8. 20.
android11 intent 패키지명으로 외부 앱 실행 시 안되는 현상 try{ Intent intent = getPackageManager().getLaunchIntentForPackage(packageName); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(intent); } catch (Exception e){ e.printStackTrace(); String url = "market://details?id=" + packageName; Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); startActivity(i); } 원래는 이렇게 하여서 패키지명으로 외부앱을 실행했습니다! 근데 안드로이드 11을 타겟팅하신다고 하시면 메니페스트에서 하나 추가해주.. 2021. 7. 22.
Android (타이머) 시간마다 실행하기 (주기별 실행) Timer timer = new Timer(); TimerTask timerTask = new TimerTask() { @Override public void run() { //5초마다 실행 } }; timer.schedule(timerTask,0,5000); ms단위로 적어주시면 됩니다. 2021. 7. 2.