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
| public class TimeAgoUtils{ | |
| public static String getValue(String yourPostingTime){ | |
| SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", new Locale("id", "ID")); //set your locale | |
| Date postDate; | |
| Date currentDate; | |
| try { | |
| AppController.inputDate2.setTimeZone(TimeZone.getTimeZone("GMT+7")); //set your GMT server current time | |
| postDate = sdf1.parse(yourPostingTime); | |
| long postDateTime = postDate.getTime(); |
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
| View dialogView = getLayoutInflater().inflate(R.layout.custom_dialog, null); | |
| Dialog customDialog = new Dialog(this, R.style.CustomDialog); | |
| customDialog.setContentView(dialogView); | |
| customDialog.setCancelable(true); | |
| customDialog.getWindow().setLayout(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT); | |
| customDialog.show(); |
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
| StatusResponse statusResponse = new StatusResponse(param1,param2,new StatusInterface(){ | |
| @Override | |
| public void returnResponse(int status){ | |
| switch(status){ | |
| case 1: //do your stuff | |
| break; | |
| case 2: //do your stuff | |
| break; | |
| default: | |
| break; |
NewerOlder