i have tried to use StateSet.stateSetMatches(int[], int) and frankly have no idea what is it for. consider the following:
int[] stateSpec = {1, 1, 1}; int state = 1; // stateSpec == {1, 1, 1} Log.d(TAG, "onCreate " + testStateSetMatches(stateSpec, state)); stateSpec[2] = 2; // stateSpec == {1, 1, 2} Log.d(TAG, "onCreate " + testStateSetMatches(stateSpec, state)); stateSpec[2] = 0; // stateSpec == {1, 1, 0} Log.d(TAG, "onCreate " + testStateSetMatches(stateSpec, state)); and the testStateSetMatches method: private String testStateSetMatches(int[] stateSpec, int state) { StringBuilder sb = new StringBuilder("{"); for (int i = 0; i < stateSpec.length; i++) { int item = stateSpec[i]; sb.append(item); if (i + 1 < stateSpec.length) { sb.append(", "); } } boolean match = StateSet.stateSetMatches(stateSpec, state); sb.append("} vs ").append(state).append(" == ").append(match); return sb.toString(); } the logcat says: D/TestTag ( 1069): onCreate {1, 1, 1} vs 1 == true D/TestTag ( 1069): onCreate {1, 1, 2} vs 1 == false D/TestTag ( 1069): onCreate {1, 1, 0} vs 1 == true so it seems that it returns true if every element in stateSpec is equal to state *or* there is 0 somewhere in between i don't really get it, i thought it should match if there is at least one state in stateSet but it's not the case, so what is the point of this method? btw StateSet.stateSetMatches(int[], int[]) works as expected but int variant gets me crazy, can anyone explain what is it for? pskink -- -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups "Android Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.