我需要担心这个警告吗?如果我忽略警告怎么办?
这是什么警告表示:
为了让本地格式使用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)
我觉得这是如图所示日期格式以正确的方式在这里.
CardView
除了阴影或高度之外,有什么优点和缺点,性能和外观有什么好处?使用的内容CardView
也可以使用其他布局的组合来完成.
performance android android-widget android-layout android-cardview
我想使用实现的DataWrapper将我的ArrayList对象传递给另一个活动Serializable
.
我按照这里提供的答案:将用户定义对象的arraylist传递给Intent android.
我开始从另一个活动MPAndroidChart
库PieChart
的OnChartGestureListener()
.这是我传递我的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) 我正在开发一个应用程序.我不得不修改我的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)