- LocaleList(Locale...)で同じLocaleいれるとIAEでおちる。
- たとえばLocale.JAPANEとLocale.JAPANとか。
- Locale.JAPANとLocale.JAPANESEなら落ちない。これで大丈夫なんかな…?
/**
fun main(args : Array<String>) { | |
val fzbz = ::FzBz | |
fzbz(1000) | |
} | |
// countの数までFizzBuzzする | |
fun FzBz(count : Int) { | |
for (i in 1..count) { | |
if (i % 3 == 0 && i % 5 == 0){println("FizzBuzz")} | |
else if (i % 3 == 0) {println("Fizz")} | |
else if (i % 5 == 0) {println("Buzz")} |
fun main(args : Array<String>) { | |
for(num in 1..40){ | |
val aho1 = num % 3 == 0 | |
val aho2 = num.toString().contains("3") | |
val result = if (aho1 || aho2){ | |
"アホ" | |
} else{ | |
num | |
} |
public class MainActivity extends AppCompatActivity { | |
@Bind(R.id.root) | |
LinearLayout root; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
ButterKnife.bind(this); |
@RunWith(RobolectricGradleTestRunner.class) | |
@Config(constants = BuildConfig.class, sdk = 21, packageName = "com.wakwak.leakcanarytest") | |
public class ExampleUnitTest { | |
@Test | |
public void addition_isCorrect() throws Exception { | |
assertEquals(4, 2 + 2); | |
} | |
} |
Resources resources = getResources(); | |
Configuration configuration = resources.getConfiguration(); | |
configuration.setLocale(Locale.ENGLISH); // ここで取得したいLocaleを指定します。 | |
resources.updateConfiguration(configuration, null); // updateConfigurationを忘れずに… | |
// ここ以降で取得したstringはEngrishとなります。 | |
// 取得したstringでなにかする。setText()とか… | |
configuration.setLocale(Locale.getDefault()); // 設定を元に戻すのを忘れないように。 |
#!/usr/bin/env ruby | |
app_version = '' | |
file_names = [] | |
changelog_contens_ja = [] | |
changelog_contens_en = [] | |
gradle_path = '../app/build.gradle' | |
# These files are base change log. | |
changelog_path_ja = '../change_log_ja.txt' |
/** | |
* Copyright (c) 2013 Xcellent Creations, Inc. | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining | |
* a copy of this software and associated documentation files (the | |
* "Software"), to deal in the Software without restriction, including | |
* without limitation the rights to use, copy, modify, merge, publish, | |
* distribute, sublicense, and/or sell copies of the Software, and to | |
* permit persons to whom the Software is furnished to do so, subject to | |
* the following conditions: |
/** | |
* Created by Ryo on 2018/03/06. | |
*/ | |
public abstract class SwipeToDeleteCallback extends ItemTouchHelper.SimpleCallback { | |
private ColorDrawable mBackgroundColorDrawable = new ColorDrawable(); | |
private Drawable mSwipeBackIcon; | |
public SwipeToDeleteCallback(@NonNull Drawable swipeIcon, @ColorInt int swipeBackgroundColor) { |