Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save janishar/6a2cbf4f2d19c8d30e3ec45d646a83a2 to your computer and use it in GitHub Desktop.
Save janishar/6a2cbf4f2d19c8d30e3ec45d646a83a2 to your computer and use it in GitHub Desktop.
public class MainActivity extends AppCompatActivity {
private ListView repoListView;
private RepoListAdapter repoListAdapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
repoListView = (ListView) findViewById(R.id.repoListView);
repoListAdapter = new RepoListAdapter(getApplicationContext(), new ArrayList<GitRepo>());
repoListView.setAdapter(repoListAdapter);
try {
JPost.getBroadcastCenter().addSubscriber(this);
}catch (Exception e){
e.printStackTrace();
}
ApiHandler.doGitRepoGetApiCall(ApiHandler.GIT_REPO_URL);
}
@OnUiThread
@OnMessage
private void onGitRepoList(GitRepoMsg msg){
if(msg.getGitRepoList() != null) {
repoListAdapter.setGitRepoList(msg.getGitRepoList());
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment