Java tutorial
//package com.java2s; //License from project: Open Source License import android.support.annotation.NonNull; import java.util.concurrent.TimeUnit; public class Main { public static long getUpdateInterval(@NonNull final String intervalFromPreference) { final int parsedValue = Integer.valueOf(intervalFromPreference); return TimeUnit.MILLISECONDS.convert(parsedValue, TimeUnit.HOURS); } }