Android

1. 현재 날짜 public void getCurrentDate() { if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) { LocalDate now = LocalDate.now(); this.nowYear = now.getYear(); this.nowMonth = now.getMonth().getValue(); Log.d("@@@@", "nowMonth : "+ nowMonth); this.nowDay = now.getDayOfMonth(); } else { Date now = new Date(); SimpleDateFormat formatterYear = new SimpleDateFormat("yyyy"); Simple..
ViewModel을 사용하여 데이터를 저장하기 LiveData와 Factory 패턴으로 실시간 데이터 변경 1. MyViewModel.java public class MyViewModel extends ViewModel { private MutableLiveData reserves; public MutableLiveData getReserves() { if (reserves == null) { reserves = new MutableLiveData(); } return reserves; } } 2. MyViewModelFactory.java public class MyViewModelFactory implements ViewModelProvider.Factory { @NonNull @Override pu..
직접 제작한 timePicker, CalendarPicker 1. 탭 크기 조절 연동 2. 폴드 작은화면 연동 3. 폴드 큰화면 연동 4. 폴드 접엇다 펴도 데이터 연동 5. 회전시 데이터 연동 및 크기 조절 1. CalendarPickerPopupDialog.java public class CalendarPickerPopupDialog extends Dialog { private Context context; private CalendarPopupDialogClickListener CalendarPopupDialogClickListener; private CalendarView calendar_alert; private TextView tvTitle, tvNegative, tvPositive; priv..
1. Code A. UrlDao @Dao public interface UrlDao { //입력 @Insert(onConflict = REPLACE) void insert(UrlData urlData); //삭제(오버로딩 삭제) @Delete void delete(UrlData urlData); //전체삭제 @Delete void reset(List urlData); //값 선택 @Query("SELECT * FROM urlData where content = :sContent") UrlData findById(String sContent); } B. UrlData @Entity(tableName = "urlData") public class UrlData implements Serializable { ..
🔔벨91
'Android' 카테고리의 글 목록 (10 Page)