I'm coding for Android app with this function:
protected override void OnCreate(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);
SetContentView(Resource.Layout.conversation_list_activity);
listViewConversationList = FindViewById<ListView>(Resource.Id.listViewConversationPreview);
string url = ConstantManager.HOST;
HttpClient oHttpClient = new HttpClient();
var oTaskGetAsync = oHttpClient.GetAsync(new Uri(url));
oTaskGetAsync.ContinueWith((oHttpResponseMessage) =>
{
var result = oHttpResponseMessage.Result.Content.ReadAsStringAsync().Result;
listConversationPreview = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ConversationPreview>>(result);
ConversationAdapter adapter = new ConversationAdapter(this, listConversationPreview);
RunOnUiThread(() => listViewConversationList.Adapter = adapter);
listViewConversationList.ItemClick += listViewConversationList_ItemClick;
});
}
I run it successfully but after I import some Nuget Packae for Android Support Design, now it throw a message like this.
I/Choreographer( 1962): Skipped 524 frames! The application may be doing too much work on its main thread.
Could you please tell me what I've done wrong?