본문 바로가기

전체 글109

디펜던시. implementation fileTree(include: ['*.jar'], dir: 'libs') implementation 'com.android.support:appcompat-v7:26.1.0' implementation 'com.android.support.constraint:constraint-layout:1.1.0' testImplementation 'junit:junit:4.12' androidTestImplementation 'com.android.support.test:runner:1.0.1' androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1' //RxJava,RxAndroid impleme.. 2018. 6. 4.
안드로이드 연속클릭 방지 클래스. /** * 추상클래스엔 추상메서드 등록 */ public abstract class OnSingleClickListener implements View.OnClickListener { // 중복 클릭 방지 시간 설정 private final long MIN_CLICK_INTERVAL = 2000; private long mLastClickTime; public abstract void onSingleClick(View v); @Override public void onClick(View v) { /* 이거 같은 경우에는 2초안에 클릭이 이루어 지면 다시 2초를 기다린다.. // long currentClickTime = SystemClock.uptimeMillis(); // long elapsedTime.. 2018. 5. 23.
getMiddle /**가운데 문자 가져오기 홀수면 1개 짝수면 가운대 2개*/ String getMiddle(String word) { int count = word.getBytes().length; int half_count = count / 2; LogUtil.e("" + half_count); String str = null; if (count >= 3) { if (count % 2 == 0) { LogUtil.w("나누어서 나머지를 가져보니 짝수이다"); str = word.substring(half_count - 1, half_count + 1); } else { LogUtil.w("나누어서 나머지를 가져보니 홀수이다"); str = word.substring(half_count, half_count + 1);.. 2018. 4. 30.
우분투 버추얼박스에서 게스트 씨디 설치 안될때. sudo apt-get -y install gcc make linux-headers-$(uname -r) dkms 2018. 4. 27.