use of ca.etsmtl.applets.etsmobile.ui.adapter.SponsorAdapter in project ETSMobile-Android2 by ApplETS.
the class SponsorsFragment method refreshList.
public void refreshList() {
sponsorList = mSponsorManager.getSponsorList();
adapter = new SponsorAdapter(getActivity(), R.layout.row_sponsor, sponsorList, this);
sponsorGridView.setAdapter(adapter);
adapter.notifyDataSetChanged();
sponsorGridView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
Sponsor item = sponsorList.get(position);
String url = item.getUrl();
if (URLUtil.isValidUrl(url)) {
Intent internetIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
startActivity(internetIntent);
}
}
});
}
Aggregations