Created
October 3, 2016 13:28
-
-
Save janishar/6a2cbf4f2d19c8d30e3ec45d646a83a2 to your computer and use it in GitHub Desktop.
This file contains 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 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