Esempio n. 1
0
  /** 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));
  }
Esempio n. 2
0
  @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);
    }
  }