3 Replies - 832 Views - Last Post: 05 June 2017 - 12:23 AM

#1 Dialupp  Icon User is offline

  • D.I.C Head

Reputation: -2
  • View blog
  • Posts: 210
  • Joined: 31-October 16

Android not outputting my listview

Posted 01 June 2017 - 10:54 PM

My listView doesn't show contents of the method it just says "App1h.Activity" I don't get why, aren't we getting the values?

xaml file:

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="App1h.ActivityFeedPage">

    <ListView x:Name="activityFeed" HasUnevenRows="true"/>



</ContentPage>




this is the code for activityFeedPage:

 public partial class ActivityFeedPage : ContentPage
    {
        private ActivityService _service = new ActivityService();

        public ActivityFeedPage()
        {
            InitializeComponent();

            // activityFeed.ItemsSource = _service.GetActivities();

            activityFeed.ItemsSource = _service.GetActivities();
        }


    }



And finally where I am getting the data from:

    class ActivityService
    {
        public IEnumerable<Activity> GetActivities()
        {
            return new List<Activity>
            {
                new Activity { userID = 1, description = "Your Facebook friend Jenny Dalby is on Instagram." },
                new Activity { userID = 2, description = "Jonv started following you" },
                new Activity { userID = 3, description = "RachelMartin liked your photo." },
                new Activity { userID = 4, description = "Your Facebook friend Nivan Jay is on Instagram." },
                new Activity { userID = 5, description = "SanazZ sent a photo posted by @brookeisep." },
                new Activity { userID = 6, description = "NextLab started following you." },
                new Activity { userID = 7, description = "Your Facebook friend Alex B is on Instagram." },
                new Activity { userID = 8, description = "Your Facebook friend Tara Chang is on Instagram." },
                new Activity { userID = 9, description = "Your Facebook friend Tom K is on Instagram." },
            };
        }
    }



Is This A Good Question/Topic? 0
  • +

Replies To: Android not outputting my listview

#2 Dialupp  Icon User is offline

  • D.I.C Head

Reputation: -2
  • View blog
  • Posts: 210
  • Joined: 31-October 16

Re: Android not outputting my listview

Posted 04 June 2017 - 08:54 PM

bump
Was This Post Helpful? 0
  • +
  • -

#3 wseng92  Icon User is offline

  • D.I.C Regular

Reputation: 9
  • View blog
  • Posts: 288
  • Joined: 23-September 15

Re: Android not outputting my listview

Posted 04 June 2017 - 11:19 PM

What language are you using ?
Was This Post Helpful? 0
  • +
  • -

#4 Dialupp  Icon User is offline

  • D.I.C Head

Reputation: -2
  • View blog
  • Posts: 210
  • Joined: 31-October 16

Re: Android not outputting my listview

Posted 05 June 2017 - 12:23 AM

c#
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1