Java tutorial
//package com.java2s; import android.util.SparseIntArray; public class Main { public static final int WEEK_DAY_TOTAL = 7; public static SparseIntArray getWeekRepeatition(Integer repeatition) { SparseIntArray map = new SparseIntArray(); if (repeatition == null) return null; for (int i = 0; i < WEEK_DAY_TOTAL; i++) { if ((repeatition & (1 << i)) > 0) { map.put(i, 1); } else { map.put(i, 0); } } return map; } }