Tag Archives: calendar

14,954 views

How are you old – date calendar age Java Android example

Calendar dateOfYourBirth = new GregorianCalendar(1998, Calendar.SEPTEMBER, 17); Calendar today = Calendar.getInstance(); Android example. public class HoriziontalScrollActivity extends Activity { TextView txtV; Context cntx;   @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); txtV = (TextView)findViewById(R.id.idLabel); cntx = this; StringBuilder strBuild … Continue reading

Posted in Android Examples Code | Tagged , , , , | Comments Off on How are you old – date calendar age Java Android example
7,273 views

Date time difference determine which is earlier Android Java example

Date difference in millisecond between two date, GregorianCalendar, Calendar, after(), befor(), getTimeInMillis().   public class HoriziontalScrollActivity extends Activity { TextView txtV; Context cntx;   @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); txtV = (TextView)findViewById(R.id.idLabel); cntx = this; StringBuilder strBuild … Continue reading

Posted in Android Examples Code | Tagged , , , , | Comments Off on Date time difference determine which is earlier Android Java example
5,676 views

Date Calendar Java Android Example

Calendar cal = new GregorianCalendar(), int year = cal.get(Calendar.YEAR), ERA, MONTH, DAY_OF_MONTH, DAY_OF_WEEK, Android example code. public class MainActivity extends Activity { TextView txtV; Context cntx;   @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); txtV = (TextView)findViewById(R.id.idLabel); cntx = … Continue reading

Posted in Android Examples Code | Tagged , , , | Comments Off on Date Calendar Java Android Example
9,681 views

Timer stopwatch based on Java Calendar class Android example

Start Stop Stopwatch Timer Android example source code. private static long mStartTime = 0L; Calendar cal; TextView hTextViewVypis = (TextView)findViewById(R.id.idTextVypis);   void start(){ cal = Calendar.getInstance(); mStartTime = cal.getTimeInMillis(); }   void stop(){ prinOutStopWatchTime(); }     private void prinOutStopWatchTime() … Continue reading

Posted in Android Examples Code | Tagged , , , , , | Comments Off on Timer stopwatch based on Java Calendar class Android example