전체 글 (108) 썸네일형 리스트형 안드로이드 스튜디오 / Firebase Could not deserialize object 에러 ~~~ does not define a no-rgument constructor. If you are using ProGuard, make sure these constructors are not stripped. 해당 오류는 Firebase의 객체를 역직렬화 하려면 DTO 클래스에 빈 생성자가 필요해서 발생한 것이다. 따라서, DTO클래스의 멤버 변수에 default 값을 주는 것으로 해결 가능하다. data class User ( val email : String = "", val name : String ="", val image : String = "", val uid : String = "" ) 객체 데이터 초기화해주기~ 안드로이드 스튜디오 / Google SignInButton Text 수정 방법 구글 로그인 버튼의 Text를 바꾸고 싶었다. 조금 옛날 글이지만 역시.. 해결책은 존재했다. https://stackoverflow.com/questions/18040815/can-i-edit-the-text-of-sign-in-button-on-google/27838453#27838453 Can I edit the text of sign in button on Google? I am integrating my application with google plus. I have installed google play services and signed in to my account. Also I could publish and plus one for what ever I want. My problem I.. 안드로이드 스튜디오 / layout 둥근 모서리 적용 1. drawable 폴더 안에 layout_radius.xml 파일 생성 shape으로 감싸고 안에 상세 속성들을 넣어준다. - solid : 뷰의 background - corners : 모서리 부분 bottomRightRadius, bottomLeftRadius, topLeftRadius, topRightRadius 따로 적용 가능 2. layout에 적용 android:background="@drawable/layout_radius" 안드로이드 스튜디오/ Retrofit/OkHttpClient 로그 찍는 방법 Retrofit에서 모든 통신을 로그찍어서 보고 싶다면 addInterceptor를 해주면 된다. //설명추가 예정 val httpLoggingInterceptor = HttpLoggingInterceptor() httpLoggingInterceptor.apply{ httpLoggingInterceptor.level = HttpLoggingInterceptor.Level.BODY } OkHttpClient.Builder() .addInterceptor(httpLoggingInterceptor) .build() 안드로이드 스튜디오/ startActivityForResult Deprecated startActivityForResult가 Deprecated 되었다. 요즘 registerForActivityResult로 대체해서 쓰고있다. 1. intentParam() 따로 빼주기 (필수X, 편의상 ) fun getIntentParam(): Intent{ val newIntent = Intent(this.context,Activity::class.java) newIntetn.putExtra() return newIntent } 2. registerForActivityResult 사용하기 private var getResult = registerForActivityResult(ActivityResultContracts.StartActivityForResult()){ if(it.resultCode =.. 안드로이드 스튜디오 / fragment에서 finish() 구현하기 activity?.finish() Activity에서는 finish() 하면 된다. Fragment 에서는 finish()메서드를 바로 호출하지 못하기 때문에 activity?.supportFragmentManager ?.beginTransaction() ?.remove(this@ProfileFragment) ?.commit() or activity?.finish() fragment내에서 'activity.'를 해주면 이 framgment가 현재 연결되어있는 FragmentActivity 를 반환해준다. -> finish 사용 가능 안드로이드 스튜디오 / ScrollView can host only one direct child 오류 해결 Caused by: android.view.InflateException: Binary XML file line #38: ScrollView can host only one direct child Caused by: java.lang.IllegalStateException: ScrollView can host only one direct child Scrollview는 하나의 Child만 가질 수 있다. 따라서 View가 여러개라면 (ex. Recyclerview, Linearlayout 등) LinearLayout 같은 Layout으로 한 번 더 감싸주어야 한다. Git / 소스트리에서 마지막 커밋메세지 수정 방법 1. 커밋옵션 - 마지막 커밋 정정 2. 마마지막 커밋메세지가 뜨면 수정하고, 오른쪽 맨 밑 커밋 버튼 눌러주면 됨 ** 주의사항 - 푸시 전에 해야됨 - 푸시를 해버리고, 커밋메세지를 수정하면... 머지도 당하고, 메세지가 수정된게 아니고 메세지 추가가 된다.(지저분해짐) - 어떻게 알았냐고요...? 저도 알고싶지 않았어요 이전 1 ··· 9 10 11 12 13 14 다음