목록Android (27)
막무가내 삽질 블로그
최근에 프로젝트 참여중 한가지 이상한점을 발견했다. 액티비티가 onDestroy 되었는데 계속 살아나는 것이였다............ ????????????????????????????????? 이건 무슨 상황인가 싶었다. A 액티비티에서 서버로 데이터를 전송 후 결과를 받으면 B 액티비티로 이동하고 B 액티비티에서 웹뷰가 띄워지는 구조다. 웹뷰를 종료 시키고 해당 액티비티를 나왔을때 finish()를 시켜주고 다시 백키를 누르면 웹뷰로 들어가졌다.... 뭐지??????싶었다. 웹뷰라는 앱 외부 코드라도 해당 액티비티가 죽었는데..... 왜 살아나지...? 여기저기 찾아보다 웹뷰를 강제로 죽이는 방법, remove 하는 방법 이것저것 해봤는데 해결 하지 못했다. 그러던 도중 액티비티가 onDestroy ..
뷰(View) 뷰는 안드로이드 화면의 구성요소이다. 즉 화면에 보이는 모든 것은 View EditText -> 사용자 직접 입력할 수 있는 뷰 Button -> 사용자가 터치할 수 있는 뷰 TextView -> 사용자에게 텍스트를 출력하는 뷰 ImageView -> 사용자에게 이미지를 출력하는 뷰 뷰는 자신이 화면 어디에 배치되어야 하는지에 대한 정보가 없다. 뷰만으로 화면에 나타날 수 없다. 뷰를 화면에 배치하기 위해서는 반드시 무언가가 필요하다. 그것이 바로 뷰그룹(ViewGrop) 혹은 뷰컨테이너(Container)이다. 뷰그륩(ViewGrop) n개의 View를 담을 수 있는 컨테이너이다. ViewGrop 또한 View를 상속받아 만든 클래스. 또 다른 말로는 레이아웃이라고도 한다. 뷰그룹은 뷰만..
안드로이드에서 다이얼로그를 만들 후 dismiss를 시키지 않고 Activity를 종료한 후 WindowManager를 이용하여 addView를 추가 시키고자 할때 에러 메시지 E/WindowManager( 1374): Activity com.jjoe64.example.MainActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@405446f8 that was originally added here E/WindowManager( 1374): android.view.WindowLeaked: Activity com.jjoe64.example.MainActivity has leaked window com.android..
dialog 생성시 context 에 getApplicationContext() 로 사용해서 나는 오류 AlertDialog.Builder builder = new AlertDialog.Builder(액티비티이름.this); 끝
안드랑 깃헙이랑 연동을 끝내놓고 중간중간 작업 후 add commit push 방법 1. 안드로이드 좌측 상단쪽에 보면 디폴트값이 Android로 되어있는데 이걸 Project로 선택 2. 선택 후 제일 최상단에 프로젝트명에 마우스 우클릭 후 git -> add ( add 하면 붉은색 파일명들이 녹색으로 변경됨 ) 3. 최상단에 VCS -> Commit -> Commit Changes 창이 뜨면 우측 하단에 Commit -> Commit and Push로 선택 4. 왜 커밋하는지 이유를 써달라고 창뜸 -> commit message에 내용 작성 후 commit and push 5. 경고 무시 후 commit and push 선택 -> push 6. 끝 깃헙 확인
참고자료 Difference between FragmentPagerAdapter and FragmentStatePagerAdapter, getSupportFragmentManager() and getChildFragmentManager() Difference between FragmentPagerAdapter and FragmentStatePagerAdapter Here is a log lifecycle of each fragment in ViewPager which have 4 fragment and offscreenPageLimit = 1 (default value) viblo.asia FragmentStatePagerAdapter deprecated from api 27
오늘은 데이터 수정,삭제코드를 정리한다. 우선 삭제 메소드 부터 보자 private void deleteItem(final int position) { mStorage.getReference().child("userImages").child("uid/").child(contentslist.get(position).photoName).delete() .addOnSuccessListener(new OnSuccessListener() { @Override public void onSuccess(Void aVoid) { // removeValue 말고 setValue(null)도 삭제가능 mDatabase.getReference().child("contents").child("content").child(uid..
사용자가 게시했을때 필요정보들을 모아둔 클래스이다. int startCount, Map stars는 나중에 정리할 예정이다. public class PostModel { public String myid; // 로그인한 아이디 public String photo; // 게시글 사진 public String photoName; // 게시글사진 이름(사진삭제할때 필요, 절대경로를 뜻함) public String contents; // 게시글 내용 // public String person; // 친구태그 public String location; // 위치 public String userprofileimage; // 회원가입시 프로필사진 public String username; // 회원가입시 닉네임 p..