Created
April 2, 2018 23:05
-
-
Save hkakutalua/864db7b34aa298588b61882f336ce391 to your computer and use it in GitHub Desktop.
Initialize loader
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
| @Override | |
| protected void onCreate(Bundle savedInstanceState) { | |
| super.onCreate(savedInstanceState); | |
| setContentView(R.layout.activity_main); | |
| Retrofit retrofit = new Retrofit.Builder() | |
| .baseUrl("https://api.github.com") | |
| .addConverterFactory(GsonConverterFactory.create()) | |
| .build(); | |
| mGithubService = retrofit.create(GithubService.class); | |
| mAdapter = new UsersAdapter(); | |
| RecyclerView recyclerView = findViewById(R.id.recycler_view_users); | |
| recyclerView.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false)); | |
| recyclerView.setAdapter(mAdapter); | |
| getSupportLoaderManager().initLoader(LOADER_ID, null, this); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment