Last active
June 24, 2018 17:12
-
-
Save sharifulislam52/1cca507e66296459ae3fec6a4ecd352d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // system current second | |
| public int the_current_second(){ | |
| int the_second = new Time(System.currentTimeMillis()).getSeconds(); | |
| return the_second; | |
| } | |
| // return current day of week | |
| public String current_day(){ | |
| Date date = new Date(); | |
| CharSequence this_day = DateFormat.format("EEEE", date.getTime()); // gives like (Wednesday) | |
| return this_day.toString(); | |
| } | |
| // current date | |
| import java.util.Date; | |
| import java.util.Calendar; | |
| import java.text.SimpleDateFormat; | |
| public String get_current_date(){ | |
| Date current_date = Calendar.getInstance().getTime(); | |
| SimpleDateFormat df = new SimpleDateFormat("dd/MM/yyyy"); | |
| String formattedDate = df.format(current_date); | |
| return formattedDate; | |
| } | |
| // open keybord | |
| public void opern_keybord(){ | |
| InputMethodManager imm = (InputMethodManager)getSystemService(this.INPUT_METHOD_SERVICE); | |
| imm.toggleSoftInput(InputMethodManager.SHOW_FORCED,0); | |
| } | |
| // cose keybord | |
| public void close_keybord(){ | |
| InputMethodManager imm = (InputMethodManager)getSystemService(this.INPUT_METHOD_SERVICE); | |
| imm.hideSoftInputFromWindow(this.getCurrentFocus().getWindowToken(), 0); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment