/** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); adapter = SteamAdapters.getFriendsAdapter(); setListAdapter(adapter); getListView().setBackgroundColor(getResources().getColor(R.color.listBackground)); }
@Override protected void onListItemClick(ListView l, View v, int position, long id) { super.onListItemClick(l, v, position, id); Friend friend = (Friend) adapter.getItem(position); if (friend.isAvailable() || SteamAdapters.getChatAdapter(friend).getCount() > 0) { Intent intent = new Intent(Friends.this, Chat.class); intent.putExtra("steamid", friend.getSteamId()); startActivity(intent); } else { SteamAlerts.showAlert("Warning", friend.getName() + " is offline", this); } }