我有一个Android应用程序,像限制一些应用程序类别,如游戏.所以如果我停止我的Android设备中的所有游戏应用程序,那么它是如何可能的 我如何得到这个应用程序是游戏或天气或医疗等.
有任何想法吗....
在这里,我发现维护一个简单的日期响应以获取12小时和24小时的问题。两种时间的日期格式不同。我目前使用的代码:
我的日期字符串响应=“ 2011-12-12T19:41:15.17Z”
private static final SimpleDateFormat dateFormatToolTipResponse = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ");
private SimpleDateFormat cunsultationPostTimezone12 = new SimpleDateFormat("MM/dd/yy hh:mm a z");
private SimpleDateFormat cunsultationPostTimezone24 = new SimpleDateFormat("MM/dd/yy HH:MM z");
public String formateDateTimeConsultation(String dateTime)
{
StringBuffer strResult = new StringBuffer();
strResult.append(getPostTimecunsultation(parseDate(dateTime)));
return strResult.toString();
}
private static Date parseDate(String date)
{
try {
return dateFormatToolTipResponse.parse(date);
} catch ( Exception e ){
return null;
}
}
private String getPostTimecunsultation(Date date)
{
if(date != null){
if(ConstantCodes.is24Hours)
{
return cunsultationPostTimezone24.format(date);
}
else
{
return cunsultationPostTimezone12.format(date); …Run Code Online (Sandbox Code Playgroud)