long start = System.currentTimeMillis();
//測定したい処理
long end = System.currentTimeMillis();
Log.d("タグ", "measure: " + (end - start) +" ms");
2012年7月5日木曜日
処理時間の測定
2011年5月31日火曜日
文字列比較
間違い
正解
間違いでもエラーが出ないので悩ましい。
String x = "android";
if (x == "android")
{
処理
}
正解
String x = "android";
if (x.equals("android"))
{
処理
}
間違いでもエラーが出ないので悩ましい。
登録:
投稿 (Atom)