//Checks to see if there is already a conversation between the device and emulator private Conversation _GetConversation() { if (activeConversation == null) { LayerQuery query = LayerQuery.InvokeBuilder(Java.Lang.Class.FromType(typeof(Conversation))) .Predicate(new Predicate(Conversation.Property.Participants, Predicate.Operator.EqualTo, new Java.Util.ArrayList(MainActivity.GetAllParticipants()))) .SortDescriptor(new SortDescriptor(Conversation.Property.CreatedAt, SortDescriptor.Order.Descending)) .Build(); IList results = layerClient.ExecuteQuery(query, LayerQuery.ResultType.Objects); if (results != null && results.Count > 0) { return(results[0] as Conversation); } } //Returns the active conversation (which is null by default) return(activeConversation); }