Java 3

Android Theme.MaterialComponents의 button 문제

안드로이드 style에 Theme.MaterialComponents 와 관련된 theme을 적용하면 Button을 커스터마이징 하는데 문제가 생긴다. (필자의 경우 drawable에 정의한 background를 적용하려고 했는데 듣지를 않았다...) https://stackoverflow.com/a/52751122/7017299 when use Theme.MaterialComponents.Light.NoActionBar style, set button background not effect In order to use Chip and ChipGroup , i set Application style extends "Theme.MaterialComponents.Light.NoActionBar" int man..

Study/Java, Android 2019.04.10

Uri를 Intent로 전달 할 때...

폰 내부에 있는 영상을 앱에서 View 띄우기 위해서 Uri를 이용했다. 임시로 Download 폴더에 넣음 → Download 까지 절대경로를 이용하여 파일 객체를 만듬 new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS), 비디오 파일 경로) → 파일로 부터 URI를 구함 Uri.fromFile(파일 객체) → URI를 이용하여 영상을 띄움 (VideoView 또는 다른 라이브러리 이용) → Fragment 에서 Activity로 URI를 Intent에 담아서 전송 (startActivity(Intent)) → Activity에서 받은 URI를 활용 intent.getParcelable(키 값) 문..

Study/Java, Android 2018.11.13

[JAVA] 형변환 연구

> byte[] packet = ByteBuffer.allocate(1).put(command).array(); int >> 123public int byte2Int(byte src) { return src & 0xFF; }Colored by Color Scriptercs ※ 자바에서 byte는 sign이기 때문에 범위 표현이 -128 ~ 127 이다.그래서 (byte) 0xFF를 int에 아무 것도 안하고 그대로 대입하면 -1이 나와 버린다. int >>12345678 public int byte2Int(byte[] source) { int source_1 = source[0] & 0xFF; int source_2 = source[1] & 0xFF; int source_3 = source[2] & 0x..

Study/Java, Android 2018.05.14