Search in sources :

Example 1 with AccountAdapter

use of eu.siacs.conversations.ui.adapter.AccountAdapter in project Conversations by siacs.

the class ManageAccountActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.manage_accounts);
    if (savedInstanceState != null) {
        String jid = savedInstanceState.getString(STATE_SELECTED_ACCOUNT);
        if (jid != null) {
            try {
                this.selectedAccountJid = Jid.fromString(jid);
            } catch (InvalidJidException e) {
                this.selectedAccountJid = null;
            }
        }
    }
    accountListView = (ListView) findViewById(R.id.account_list);
    this.mAccountAdapter = new AccountAdapter(this, accountList);
    accountListView.setAdapter(this.mAccountAdapter);
    accountListView.setOnItemClickListener(new OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView<?> arg0, View view, int position, long arg3) {
            switchToAccount(accountList.get(position));
        }
    });
    registerForContextMenu(accountListView);
}
Also used : OnItemClickListener(android.widget.AdapterView.OnItemClickListener) InvalidJidException(eu.siacs.conversations.xmpp.jid.InvalidJidException) AccountAdapter(eu.siacs.conversations.ui.adapter.AccountAdapter) View(android.view.View) AdapterView(android.widget.AdapterView) ListView(android.widget.ListView)

Aggregations

View (android.view.View)1 AdapterView (android.widget.AdapterView)1 OnItemClickListener (android.widget.AdapterView.OnItemClickListener)1 ListView (android.widget.ListView)1 AccountAdapter (eu.siacs.conversations.ui.adapter.AccountAdapter)1 InvalidJidException (eu.siacs.conversations.xmpp.jid.InvalidJidException)1