In this post we explains how to display formatted calendar using String.format().Let's hae a look. Download and use... import java.util.Calendar; import android.app.Activity; import android.os.Bundle; import android.widget.TextView; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); TextView cal = (TextView)findViewById(R.id.viewdate); Calendar calendar = Calendar.getInstance(); cal.setText( String.format("%td-%tm-%tY\n", calendar, calendar, calendar) + String.format("%ty/%tm/%td\n", calendar, calendar, calendar) + String.format("%tI:%tM:%tS %tp\n", calendar, calendar, calendar, calendar) + "\n" + String.format("%tD\n", calendar) + String.format("%tc\n", calendar) + String....
A blog where you can find all codes for Android, Corona, Basic tutorials, Interview questions and more...