[assert] 사용법
Android/Tips 2014. 10. 28. 10:58 |assert를 켤 때,
adb shell setprop debug.assert 1(true)
assert를 끌 때,
adb shell setprop debug.assert 0(false)
소스상에서 두개의 값이 일치하는지 확인하고 싶을 때,
(두 개의 값이 틀리면 다음 진행에 문제가 발생할 시,)
소스에 다음 한줄을 추가하면, 해당부분에서 두 값이 다르다면 exception을 발생 시킨다.
assert A(조건) == B(조건);
ex)
assert holderVMedia.getCount() == arrayListBottomBarItems.size();
'Android > Tips' 카테고리의 다른 글
ParentView에서의 Event를 ChildView에 전달하는 방법 (0) | 2015.03.24 |
---|---|
Round Componet 만들기 (0) | 2015.02.04 |
[lint] 사용하지 않는 String, 번역빠진 String 찾기 (0) | 2014.08.28 |
[TypedValue] DP, pixel간 변환 (0) | 2014.08.26 |
[ADB] 어플리케이션의 cache 지우기 (0) | 2014.08.12 |