Java tutorial
//package com.java2s; import android.widget.TextView; public class Main { public static int readTime(TextView tv) { String timeText = tv.getText().toString(); String[] timeArr = timeText.split(":"); if (timeArr != null && timeArr.length > 1) { int sec = Integer.parseInt(timeArr[1]); int min = Integer.parseInt(timeArr[0]); return (60 * min) + sec; } return 0; } }