Created
May 8, 2015 07:47
-
-
Save Nkzn/205a6fb2946a1680a6d2 to your computer and use it in GitHub Desktop.
できるかなと思ったらできちゃったやつ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class ListActivity extends AppCompatActivity { | |
| @InjectView(R.id.list_view) | |
| ListView listView; | |
| public void onCreate(Bundle savedInstanceState) { | |
| super(savedInstanceState); | |
| ButterKnife.inject(this); | |
| Observable.just( | |
| R.string.listitem1, | |
| R.string.listitem2, | |
| R.string.listitem3, | |
| R.string.listitem4, | |
| R.string.listitem5) | |
| .map(this::getString) | |
| .collect( | |
| () -> new ArrayAdapter<>(this, android.R.layout.simple_list_item_1), | |
| ArrayAdapter::add) | |
| .subscribe(listView::setAdapter); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment