Hello Java8 for Android
Lambda expressionsを試してみました。
...
findViewById(R.id.button).setOnClickListener(this::showToast);
}
private void showToast(View view) {
Toast.makeText(view.getContext(), "Java 8 Language Features Lambda expressions", Toast.LENGTH_LONG).show();
}
I tried Lambda expressions.
...
findViewById (R.id.button) .setOnClickListener (this :: showToast);
}
private void showToast (View view) {
Toast.makeText (view.getContext (), "Java 8 Language Features Lambda expressions", Toast.LENGTH_LONG) .show ();
}