Dev 283

Android Error - Caused by: android.view.InflateException: Binary XML file line #0:

Android XML 관련 에러 Caused by: android.view.InflateException: Binary XML file line #0: Attempt to invoke virtual method 'boolean java.lang.String.equals(java.lang.Object)' on a null object referenceCaused by: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.equals(java.lang.Object)' on a null object reference XML 에서 구현해야 하는데 라고 소문자로 적어서 발생했다. 참고 : https://..

Dev/Error 2018.02.07

XML 에서 id 설정에 관해서

XML 에서 id 설정에 관해서 A.XML B.XML...... 위와같이 XML 을 만들었었다. 그리고 ButterKnife 를 사용해서 BindView 를 했는데, 자꾸 id 가 잘못되었다고 뜨는 것이었다.처음에는 어디가 문제인지 찾지 못했었다. 그러다가 왜 자꾸 id 가 잘못됐다고 뜨는지 모르다가, 설마 id 가 겹치나? 해서 A.XML 의 include 에서 id 를 제거하니깐 잘 돌아갔다. include 가 B.XML 을 가리키고 가장 상위의 viewGrpoup 에 id 를 설정했는데 A.XML 에서 또 id 를 설정하니 오류가 발생한거였다.include 한 레이어와 B.XML 의 레이어를 다르다고 생각했었다.....

Dev/Android 2018.01.29

Android 날짜 및 시간 자동 설정 체크 - Automatic date and time check

날짜 및 시간 자동 설정 체크 public static boolean isTimeAutomatic(Context c) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { return Settings.Global.getInt(c.getContentResolver(), Settings.Global.AUTO_TIME, 0) == 1; } else { return android.provider.Settings.System.getInt(c.getContentResolver(), android.provider.Settings.System.AUTO_TIME, 0) == 1; }} 젤리빈 이전에는 Settings 의 System 클래스에서 세팅값 ..

Dev/Android 2018.01.17

Android 네트워크 시간 가져오는 방법

Android 네트워크 시간 가져오는 방법 해당 어플리케이션이 자동 시간을 해제할 경우 네트워크 시간을 가져오기 위해서 검색했습니다.네트워크 시간을 가져오기 전에 날짜 및 시간 체크가 자동설정으로 되어있는지 체크를 하고 진행했습니다. -> 날짜 및 시간 자동 설정 체크 참고 코드public static final String TIME_SERVER = "pool.ntp.org"; public static long getCurrentNetworkTime() { NTPUDPClient lNTPUDPClient = new NTPUDPClient(); lNTPUDPClient.setDefaultTimeout(3000); long returnTime = 0; try { lNTPUDPClient.open(); Ine..

Dev/Android 2018.01.17

Listview 관련 Error - The content of the adapter has changed but ListView did not receive a notification. Make sure the content of your adapter is not modified from a background thread, but only from the UI thread

Listview 관련 ErrorThe content of the adapter has changed but ListView did not receive a notification. Make sure the content of your adapter is not modified from a background thread, but only from the UI thread 상황 : 현재 SM-T813 디바이스 에서 발생. 성능이 더 좋은 디바이스(SM-T815NO)에서는 발생하지 않는 이슈. 해결 : 참고 블로그의 말대로 UI 쓰레드를 돌리면서 진행. 다만, 이런 문제도 디바이스 성능이 뛰어나면 나오지 않는걸 보고, 디바이스가 너무 좋으면 코드가 개판이래도 돌아가니깐, 내가 짠 코드가 문제 없구나를 생각할..

Dev/Error 2017.12.27

카메라 앱 열면서 앱 중지 android.os.FileUriExposedException

카메라 앱 열면서 앱 중지android.os.FileUriExposedException 현상 : 카메라 앱 열면서 앱 중지 원인 : targetSdkVersion 을 올렸기 때문에 발생 (23 -> 26)해결 : 이전대로 targetSkdVersion 을 낮추던지 아래와 같이 파일 접근 방법을 바꾸던지Uri photoURI = FileProvider.getUriForFile(context, context.getApplicationContext().getPackageName() + ".my.package.name.provider", createImageFile()); E/AndroidRuntime: FATAL EXCEPTION: mainProcess: com.iofit.tablet, PID: 30756an..

Dev/Error 2017.12.22

Android ConnectivityManager.getNetworkInfo() NullPointerException

ConnectivityManager.getNetworkInfo() NullPointerException 디바이스 : 태블릿 Galaxy Tab S2 (SM-T813)OS : AndroidOS Version: 7.0특징 : SM-T815N0 은 괜찮음. ConnectivityManager connectivityManager = (ConnectivityManager) getActivity().getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo mobile = connectivityManager.getNetworkInfo(ConnectivityManager.TYPE_MOBILE); NetworkInfo wifi = connectivityManager.ge..

Dev/Error 2017.12.21