Created
April 7, 2015 02:59
-
-
Save angelobelchior/8ab924e9850a8ba84565 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
namespace MyApp | |
{ | |
[Activity (Label = "MyApp", MainLauncher = true, Icon = "@drawable/icon")] | |
public class MainActivity : Activity | |
{ | |
protected override void OnCreate (Bundle bundle) | |
{ | |
base.OnCreate (bundle); | |
// Set our view from the "main" layout resource | |
SetContentView (Resource.Layout.Main); | |
var txtUser = FindViewById<EditText>(Resource.Id.txtUser); | |
var btnSearch = FindViewById<Button>(Resource.Id.btnSearch); | |
var lvwRepositories = FindViewById<ListView>(Resource.Id.lvwRepositories); | |
btnSearch.Click += async (object sender, EventArgs e) => { | |
var github = new Shared.GitHubApi(); | |
var repositories = await github.GetAsync(txtUser.Text); | |
lvwRepositories.Adapter = new ArrayAdapter(this, Android.Resource.Layout.SimpleListItemSingleChoice, repositories); | |
}; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment