小编Moh*_*Ali的帖子

SimpleDateFormat警告要获取本地格式,请使用getDateInstance(),getDateTimeInstance()或getTimeInstance(),

我需要担心这个警告吗?如果我忽略警告怎么办?
这是什么警告表示:
为了让本地格式使用getDateInstance(),getDateTimeInstance()或者getTimeInstance(),也可以使用new SimpleDateFormat(String template, Locale locale)具有例如Locale.US用于ASCII日期.
在下面的代码的第二行.该应用程序与代码正常工作.我想显示日期,例如19 Nov 2014.

public static String getFormattedDate(long calendarTimeInMilliseconds) {
    SimpleDateFormat sdfDate = new SimpleDateFormat("d MMM yyyy");  //ON THIS LINE
    Date now = new Date();
    now.setTime(calendarTimeInMilliseconds);
    String strDate = sdfDate.format(now);
    return strDate;
}
Run Code Online (Sandbox Code Playgroud)

我觉得这是如图所示日期格式以正确的方式在这里.

java android simpledateformat

26
推荐指数
2
解决办法
1万
查看次数

CardView的优缺点

CardView除了阴影或高度之外,有什么优点和缺点,性能和外观有什么好处?使用的内容CardView也可以使用其他布局的组合来完成.

performance android android-widget android-layout android-cardview

20
推荐指数
1
解决办法
5294
查看次数

java.lang.RuntimeException:Parcelable遇到IOException,在Android中传递ArrayList对象编写可序列化对象

我想使用实现的DataWrapper将我的ArrayList对象传递给另一个活动Serializable.
我按照这里提供的答案:将用户定义对象的arraylist传递给Intent android.
我开始从另一个活动MPAndroidChartPieChartOnChartGestureListener().这是我传递我的ArrayList对象的方式threadList:

mChart.setOnChartGestureListener(new OnChartGestureListener() {
@Override
public void onChartSingleTapped(MotionEvent me) {
    Intent intent = new Intent(MainActivity.this, TextersSmsActivity.class);
    intent.putExtra("threadList", new DataWrapper(threadList));
    MainActivity.this.startActivity(intent);
}
//.....
}
Run Code Online (Sandbox Code Playgroud)

我像这样实现了DataWrapper类:

public class DataWrapper implements Serializable {
private static final long serialVersionUID = 100L;
private ArrayList<OneThread> threadList;

   public DataWrapper(ArrayList<OneThread> threadList) {
      this.threadList = threadList;
   }

   public ArrayList<OneThread> getThreadList() {
      return threadList;
   }
}
Run Code Online (Sandbox Code Playgroud)

并得到Parcelable encountered IOException writing serializable object错误.这是我的Logcat:

11-29 …
Run Code Online (Sandbox Code Playgroud)

java serialization android arraylist mpandroidchart

11
推荐指数
1
解决办法
3万
查看次数

eclipse.ini中参数XXMaxPermSize,vmargs,Xms和Xms的用途,他们做了什么

我正在开发一个应用程序.我不得不修改我的eclipse.ini所以我想知道这些参数的目的和含义XXMaxPermSize, vmargs, Xms and Xms,以便正确使用它们.我在ubuntu 14.04上使用eclipse 3.8,使用java 7.

--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Xms40m
-Xmx384m
-Dorg.eclipse.equinox.p2.reconciler.dropins.directory=/usr/share/eclipse/dropins
Run Code Online (Sandbox Code Playgroud)

java eclipse ubuntu android out-of-memory

9
推荐指数
1
解决办法
2万
查看次数