전체 글

Kotlin, Android
Android/삽질

setOnClickListener, Toast

setOnClickListener는 자바로 쓸 때 몇 가지 절차가 있다. new로 OnClickListener의 새 객체임을 명시해줘야 override 함수가 딱 나타난다. 이때 onClick 내부의 코드는 메인쓰레드 위에서 돌아가므로 우선순위가 높다고 할 수 있겠다. The system executes the code in onClick on the main thread. This means your onClick code must execute quickly to avoid delaying your app's response to further user actions. See Keeping Your App Responsive for more details. https://developer.androi..

Android/삽질

Glide : Failed to load resource/java.net.SocketException(socket failed: EPERM (Operation not permitted)) 오류

2021-12-02 00:06:18.710 6659-6659/com.example.android W/Glide: Load failed for https://i.pinimg.com/736x/dc/ab/b7/dcabb7fbb2f763d680d20a3d228cc6f9.jpg with size [1050x1050] class com.bumptech.glide.load.engine.GlideException: Failed to load resource There was 1 cause: java.net.SocketException(socket failed: EPERM (Operation not permitted)) call GlideException#logRootCauses(String) for more detai..

Android/삽질

Fragment에서 Activity로 값 전달하기, getView()

fragment를 공부하던 중 activity와 값을 주고 받는 부분에서 문제가 생겼다. activity에서 fragment로 값을 줄 때는 argument와 bundle로 줄 수 있는데 fragment에서 activity로 값을 줄 때는 interface를 직접 만들어 넘겨야 했기 때문에다. 이렇게 인터페이스를 만들어주고, findViewById를 통해 뷰를 연결하려고 하니 예시대로 진행되지않았다. fragment에서 뷰를 인지하지 못하고 있어 생긴 문제였다. 구글링을 통해 알아낸 결과, getView()를 달아서 해결할 수 있었다. https://developer.android.com/reference/android/app/Fragment#getView() Fragment | Android Devel..

Android/삽질

addTextChangedListener 다루기

인터넷 웹페이지를 인텐트로 띄우는 과제를 하던중 문제가 생겼다. edittext의 내용을 가져와서 그걸 parse시켜야하는데 구글링하기 전에 IDE내부와 공식문서를 찾아봤다. edittext의 내용을 가져오는 부분에서 막혔다. setOnEditorActionListener가 유력해보였다. 그래서 안드로이드 공식문서에 검색을 해보니 그다지 도움이 되는 내용이 없었다. https://developer.android.com/reference/kotlin/android/widget/TextView.OnEditorActionListener TextView.OnEditorActionListener | Android Developers developer.android.com 좀 찾아보니까 이런게 나왔다. setOnE..

kimmandooo
code