본문 바로가기

data

[Android] DataBinding - findViewById 이제 안녕~ 정말 구글은 개발자에게 친절한 듯 하네요.좋은 라이브러리가 있어서 공유 하고자 합니다. DataBinding을 할 수 있는 라이브러리인데요. https://developer.android.com/topic/libraries/data-binding/index.html#studio_support 제가 이 라이브러리로 설명하고자 하는 내용은 아래 입니다. 1. findViewById는 이제 사용하지 않아도 된다.2. 각 View를 전역 변수로 저장해서 사용하지 않아도 된다.3. 각 View를 해당 View에 맞게 캐스트 할 필요가 없다. The Data Binding Library offers both flexibility and broad compatibility — it's a support library.. 더보기
[Android] FragmentTabHost addTab 시 Bundle 전달 아래소스와 같이 Tab을 설정 할 때 Bundle을 설정 합니다. private void addTab(String key, String data) { Bundle args = new Bundle(); args.putString(key,data); View tabView = mInflater.inflate(R.layout.fragment_layout, null, false); mTabHost.addTab(mTabHost.newTabSpec(TAG).setIndicator(tabView) , SomeFragment.class, args);} SomaFragment에서 이동한 후에는 getArguments 함수를 이용하여 데이터를 가지고 오면 됩니다. String data = getArguments().get.. 더보기
[ Android ] Read Only File System IOException ( EROFS ) /system 이나 /data 같은 경우는 android 내부의 중요한 폴더 이기 때문에,Application 에서 File을 생성하거나 삭제를 금지 시켰습니다.그래서 제목과 같은EROFS 라는 Exception이 발생하지요.. 하지만, file을 Sdcard가 아닌 내부 메모리에 저장 하고 싶을 경우에!!!무슨 수를 써서라도 Sdcard에는 파일을 쓰지 않겠다 하시는분들! String filePath = getApplicationContext().getFilesDir().getPath().toString() + "/file.txt";java.io.File file = new java.io.File(filePath); 위와 같이 자신의 Application 경로의 file을 생성하세요.이건 허용도 되며~.. 더보기