导航菜单

页面标题

页面副标题

Delta Chat v1.58.3 - ContactMultiSelectionActivity.java 源代码

正在查看: Delta Chat v1.58.3 应用的 ContactMultiSelectionActivity.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package org.thoughtcrime.securesms;

import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import java.util.ArrayList;

public class ContactMultiSelectionActivity extends ContactSelectionActivity {
    public static final String CONTACTS_EXTRA = "contacts_extra";

    @Override
    protected void onCreate(Bundle bundle, boolean z) {
        getIntent().putExtra(ContactSelectionListFragment.MULTI_SELECT, true);
        super.onCreate(bundle, z);
        getSupportActionBar().setHomeAsUpIndicator(R.drawable.ic_close_white_24dp);
        getToolbar().setUseClearButton(false);
    }

    public boolean onPrepareOptionsMenu(Menu menu) {
        MenuInflater menuInflater = getMenuInflater();
        menu.clear();
        menuInflater.inflate(R.menu.add_members, menu);
        super.onPrepareOptionsMenu(menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem menuItem) {
        super.onOptionsItemSelected(menuItem);
        if (menuItem.getItemId() != R.id.menu_add_members) {
            return false;
        }
        saveSelection();
        finish();
        return true;
    }

    private void saveSelection() {
        Intent intent = getIntent();
        intent.putIntegerArrayListExtra(CONTACTS_EXTRA, new ArrayList<>(this.contactsFragment.getSelectedContacts()));
        setResult(-1, intent);
    }
}