コード例 #1
0
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    ArtistListItem x = new ArtistListItem();
    x.Name = "qwww";

    mArtistsList = new ArrayList();

    mArtistsList.add(x);

    if (Settings.getInstance().ArtistList != null) {
      for (ArtistListItem a : Settings.getInstance().ArtistList) {
        mArtistsList.add(a);
      }
    }

    mArtistListAdapter = new ArtistAdapter(getActivity(), R.layout.list_item_artists, mArtistsList);

    setListAdapter(mArtistListAdapter);

    /*
    setListAdapter(new ArrayAdapter<DummyContent.DummyItem>(
            getActivity(),
            android.R.layout.simple_list_item_activated_1,
            android.R.id.text1,
            DummyContent.ITEMS));*/

    LocalBroadcastManager.getInstance(getActivity())
        .registerReceiver(mMessageReceiver, new IntentFilter("recieveArtistUpdate"));
  }
コード例 #2
0
 @Override
 public void onReceive(Context context, Intent intent) {
   mArtistsList.clear();
   List<ArtistListItem> artistSearchList = Settings.getInstance().ArtistList;
   for (ArtistListItem a : artistSearchList) {
     ArtistListItem artist = new ArtistListItem();
     artist.Id = a.Id;
     artist.Name = a.Name;
     artist.ImageURL = a.ImageURL;
     mArtistsList.add(a);
   }
   mArtistListAdapter.notifyDataSetChanged();
 }