Search in sources :

Example 1 with AddContactFriendsAdapter

use of com.lingtuan.firefly.contact.adapter.AddContactFriendsAdapter in project SmartMesh_Android by SmartMeshFoundation.

the class AddContactFriendsNewUI method initData.

@Override
protected void initData() {
    setTitle(getString(R.string.contact_friends));
    mList = new ArrayList<>();
    mContactListAdapter = new AddContactFriendsAdapter(mList, AddContactFriendsNewUI.this);
    mContactListAdapter.setContactListener(this);
    mListView.setAdapter(mContactListAdapter);
    contactReceiver = new RefreshContactReceiver();
    IntentFilter filter = new IntentFilter(Constants.ACTION_SELECT_CONTACT_REFRESH);
    filter.addAction(LoadDataService.ACTION_REFRESH_UNRECOMMENT);
    LocalBroadcastManager.getInstance(this).registerReceiver(contactReceiver, filter);
    mProgressDialog = LoadingDialog.showDialog(AddContactFriendsNewUI.this, null, null);
    mProgressDialog.setCancelable(false);
    mProgressDialog.setOnKeyListener(new OnKeyListener() {

        @Override
        public boolean onKey(DialogInterface dialog, int keyCode, KeyEvent event) {
            if (keyCode == KeyEvent.KEYCODE_BACK) {
                isBack = true;
                Utils.exitActivityAndBackAnim(AddContactFriendsNewUI.this, true);
            }
            return false;
        }
    });
    mProgressDialog.show();
    new ContactThread().start();
}
Also used : KeyEvent(android.view.KeyEvent) IntentFilter(android.content.IntentFilter) DialogInterface(android.content.DialogInterface) OnKeyListener(android.content.DialogInterface.OnKeyListener) AddContactFriendsAdapter(com.lingtuan.firefly.contact.adapter.AddContactFriendsAdapter) SuppressLint(android.annotation.SuppressLint)

Aggregations

SuppressLint (android.annotation.SuppressLint)1 DialogInterface (android.content.DialogInterface)1 OnKeyListener (android.content.DialogInterface.OnKeyListener)1 IntentFilter (android.content.IntentFilter)1 KeyEvent (android.view.KeyEvent)1 AddContactFriendsAdapter (com.lingtuan.firefly.contact.adapter.AddContactFriendsAdapter)1