net.bither.bitherj.core.Address Java Examples
The following examples show how to use
net.bither.bitherj.core.Address.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AddressTableModel.java From bither-desktop-java with Apache License 2.0 | 6 votes |
@Override public Object getValueAt(int i, int i2) { Address address = this.addressList.get(i); switch (i2) { case 0: if (address instanceof HDAccount) { return LocaliserUtils.getString("add_hd_account_tab_hd"); } return address.getAddress(); case 1: return address.hasPrivKey(); case 2: return Utils.compareString(address.getAddress(), selectAddress); } return ""; }
Example #2
Source File: AddressOfColdFragmentListAdapter.java From bither-android with Apache License 2.0 | 6 votes |
public AddressOfColdFragmentListAdapter(FragmentActivity activity, List<Address> privates, ColdAddressFragmentHDMListItemView.RequestHDMServerQrCodeDelegate requestHDMServerQrCodeDelegate) { this.activity = activity; this.privates = privates; this.requestHDMServerQrCodeDelegate = requestHDMServerQrCodeDelegate; if (AddressManager.getInstance().hasHDAccountCold()) { hdAccountCold = AddressManager.getInstance().getHDAccountCold(); } else { hdAccountCold = null; } if (AddressManager.getInstance().hasBitpieHDAccountCold()) { bitpieHDAccountCold = AddressManager.getInstance().getBitpieHDAccountCold(); } else { bitpieHDAccountCold = null; } if (EnterpriseHDMSeed.hasSeed()) { enterpriseHDMSeed = EnterpriseHDMSeed.seed(); } else { enterpriseHDMSeed = null; } }
Example #3
Source File: AddressProvider.java From bither-desktop-java with Apache License 2.0 | 6 votes |
@Override public void addAddress(final Address address) { try { this.mDb.getConn().setAutoCommit(false); String[] params = new String[]{address.getAddress(), address.hasPrivKey() ? address.getEncryptPrivKeyOfDb() : null, Base58.encode(address.getPubKey()), Integer.toString(address.isFromXRandom() ? 1 : 0), Integer.toString(address.isSyncComplete() ? 1 : 0), Integer.toString(address.isTrashed() ? 1 : 0), Long.toString(address.getSortTime())}; PreparedStatement stmt = this.mDb.getConn().prepareStatement(insertAddressSql); if (params != null) { for (int i = 0; i < params.length; i++) { stmt.setString(i + 1, params[i]); } } stmt.executeUpdate(); if (address.hasPrivKey()) { if (!hasPasswordSeed(this.mDb.getConn())) { PasswordSeed passwordSeed = new PasswordSeed(address.getAddress(), address.getFullEncryptPrivKeyOfDb()); addPasswordSeed(this.mDb.getConn(), passwordSeed); } } this.mDb.getConn().commit(); stmt.close(); } catch (SQLException e) { e.printStackTrace(); } }
Example #4
Source File: QRCodeEnodeUtil.java From bitherj with Apache License 2.0 | 6 votes |
public static String getPublicKeyStrOfPrivateKey() { String content = ""; List<Address> addresses = AddressManager.getInstance().getPrivKeyAddresses(); for (int i = 0; i < addresses.size(); i++) { Address address = addresses.get(i); String pubStr = ""; if (address.isFromXRandom()) { pubStr = QRCodeUtil.XRANDOM_FLAG; } pubStr = pubStr + Utils.bytesToHexString(address.getPubKey()); content += pubStr; if (i < addresses.size() - 1) { content += QRCodeUtil.QR_CODE_SPLIT; } } content.toUpperCase(Locale.US); return content; }
Example #5
Source File: TrashCanActivity.java From bither-android with Apache License 2.0 | 6 votes |
@Override public View getView(int position, View convertView, ViewGroup parent) { ViewHolder h; if (convertView == null) { if (inflater == null) { inflater = LayoutInflater.from(TrashCanActivity.this); } convertView = inflater.inflate(R.layout.list_item_trash_can, null); h = new ViewHolder(convertView); } else { h = (ViewHolder) convertView.getTag(); } Address address = getItem(position); h.tv.setText(WalletUtils.formatHash(address.getAddress(), 4, 12)); h.flAddress.setOnClickListener(new CopyClick(address.getAddress())); h.ibtnViewOnNet.setOnClickListener(new ViewOnNetClick(address, h)); if (AppSharedPreference.getInstance().getAppMode() == BitherjSettings.AppMode.HOT) { h.ibtnViewOnNet.setVisibility(View.VISIBLE); } else { h.ibtnViewOnNet.setVisibility(View.GONE); } h.ibtnRestore.setOnClickListener(new RestoreClick(address)); h.btnAlias.setOnClickListener(new AliasClick(address, h)); h.onAddressAliasChanged(address, address.getAlias()); return convertView; }
Example #6
Source File: AbstractAddressProvider.java From bitherj with Apache License 2.0 | 6 votes |
@Override public Map<String, Integer> getVanitylens() { String sql = "select * from vanity_address"; final Map<String, Integer> vanityLenMap = new HashMap<String, Integer>(); this.execQueryLoop(sql, null, new Function<ICursor, Void>() { @Nullable @Override public Void apply(@Nullable ICursor c) { int idColumn = c.getColumnIndex(AbstractDb.VanityAddressColumns.ADDRESS); String address = null; int alias = Address.VANITY_LEN_NO_EXSITS; if (idColumn > -1) { address = c.getString(idColumn); } idColumn = c.getColumnIndex(AbstractDb.VanityAddressColumns.VANITY_LEN); if (idColumn > -1) { alias = c.getInt(idColumn); } vanityLenMap.put(address, alias); return null; } }); return vanityLenMap; }
Example #7
Source File: HotAddressFragmentListAdapter.java From bither-android with Apache License 2.0 | 5 votes |
public AddressDetailClick(int position, boolean isPrivate, boolean isHDM, boolean isEnterpriseHDM, Address a) { this.position = position; this.isPrivate = isPrivate; this.isHDM = isHDM; this.isEnterpriseHDM = isEnterpriseHDM; this.a = a; }
Example #8
Source File: ImportPrivateKeyPanel.java From bither-desktop-java with Apache License 2.0 | 5 votes |
public void run() { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { } }); List<Address> addressList = PrivateKeyUtil.getECKeysFromBackupString(content, password); HDMKeychain hdmKeychain = PrivateKeyUtil.getHDMKeychain(content, password); if ((addressList == null || addressList.size() == 0) && (hdmKeychain == null)) { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { dp.dispose(); new MessageDialog(LocaliserUtils.getString("clone_from_failed")).showMsg(); } }); return; } KeyUtil.addAddressListByDesc(addressList); if (hdmKeychain != null) { KeyUtil.setHDKeyChain(hdmKeychain); } password.wipe(); SwingUtilities.invokeLater(new Runnable() { @Override public void run() { dp.dispose(); new MessageDialog(LocaliserUtils.getString("clone_from_success")).showMsg(); closePanel(); Bither.refreshFrame(); } }); }
Example #9
Source File: WalletListPanel.java From bither-desktop-java with Apache License 2.0 | 5 votes |
private void addColdAddressList(GridBagConstraints constraints, List<Address> addresses) { synchronized (walletPanels) { for (Address loopPerWalletModelData : addresses) { if (loopPerWalletModelData != null) { JPanel outerPanel = new JPanel(); outerPanel.setOpaque(false); outerPanel.setBorder(BorderFactory.createEmptyBorder(TOP_BORDER, LEFT_BORDER, 0, RIGHT_BORDER)); outerPanel.setLayout(new GridBagLayout()); GridBagConstraints constraints2 = new GridBagConstraints(); constraints2.fill = GridBagConstraints.BOTH; constraints2.gridx = 0; constraints2.gridy = 0; constraints2.weightx = 1.0; constraints2.weighty = 1.0; constraints2.gridwidth = 1; constraints2.gridheight = 1; constraints2.anchor = GridBagConstraints.CENTER; SingleColdWalletFrom coldWalletFrom = new SingleColdWalletFrom(loopPerWalletModelData, this); coldWalletFrom.getPanel().setComponentOrientation(ComponentOrientation .getOrientation(LocaliserUtils.getLocale())); outerPanel.add(coldWalletFrom.getPanel(), constraints2); walletListPanel.add(outerPanel, constraints); walletPanels.add(coldWalletFrom); constraints.gridy = constraints.gridy + 1; } } } }
Example #10
Source File: MonitorBitherColdUtil.java From bither-android with Apache License 2.0 | 5 votes |
private void addAddress(final BlockchainService service, final List<Address> wallets) { try { final ArrayList<String> addresses = new ArrayList<String>(); for (Address address : wallets) { if (!AddressManager.getInstance().getAllAddresses().contains(address)) { addresses.add(address.getAddress()); } } KeyUtil.addAddressListByDesc(service, wallets); activity.runOnUiThread(new Runnable() { @Override public void run() { if(dp != null && dp.isShowing()){ dp.dismiss(); } DropdownMessage.showDropdownMessage(activity, R.string.scan_for_all_addresses_in_bither_cold_success, new Runnable() { @Override public void run() { if (delegate != null) { delegate.onAddressMonitored(addresses); } } }); } }); } catch (Exception e) { e.printStackTrace(); DropdownMessage.showDropdownMessage(activity, R.string.network_or_connection_error); } }
Example #11
Source File: WalletUtils.java From bither-desktop-java with Apache License 2.0 | 5 votes |
public static Address findPrivateKey(String address) { for (Address bitherAddressWithPrivateKey : AddressManager.getInstance().getPrivKeyAddresses()) { if (Utils.compareString(address, bitherAddressWithPrivateKey.getAddress())) { return bitherAddressWithPrivateKey; } } return null; }
Example #12
Source File: CheckUtil.java From bither-desktop-java with Apache License 2.0 | 5 votes |
public static Check initCheckForPrivateKey( final Address address, final SecureCharSequence password) { String title = String.format(LocaliserUtils.getString("check_address_private_key_title"), address .getShortAddress()); Check check = new Check(title, new ICheckAction() { @Override public boolean check() { boolean result = new PasswordSeed(address.getAddress(), address.getFullEncryptPrivKey()).checkPassword(password); if (!result) { try { ECKey eckeyFromBackup = BackupUtil.getEckeyFromBackup( address.getAddress(), password); if (eckeyFromBackup != null) { String encryptPrivateKey = PrivateKeyUtil.getEncryptedString(eckeyFromBackup); if (!Utils.isEmpty(encryptPrivateKey)) { address.recoverFromBackup(encryptPrivateKey); result = true; } eckeyFromBackup.clearPrivateKey(); } } catch (Exception e) { e.printStackTrace(); } finally { password.wipe(); } } return result; } }); return check; }
Example #13
Source File: ColdAddressFragmentListItemView.java From bither-android with Apache License 2.0 | 5 votes |
@Override public void onAddressAliasChanged(Address address, String alias) { if (!Utils.isEmpty(alias)) { btnAlias.setText(alias); btnAlias.setVisibility(View.VISIBLE); } else { btnAlias.setText(""); btnAlias.setVisibility(View.INVISIBLE); } }
Example #14
Source File: MonitorAddress.java From bither-desktop-java with Apache License 2.0 | 5 votes |
private void addAddress( final List<Address> wallets) { try { List<String> addressList = new ArrayList<String>(); for (Address bitherAddress : wallets) { addressList.add(bitherAddress.getAddress()); } KeyUtil.addAddressListByDesc(wallets); SwingUtilities.invokeLater(new Runnable() { @Override public void run() { progressDialog.dispose(); Bither.refreshFrame(); } }); } catch (Exception e) { e.printStackTrace(); SwingUtilities.invokeLater(new Runnable() { @Override public void run() { progressDialog.dispose(); new MessageDialog(LocaliserUtils.getString("network_or_connection_error")).showMsg(); } }); } }
Example #15
Source File: CheckUtil.java From bither-desktop-java with Apache License 2.0 | 5 votes |
public static Check initCheckForPrivateKey( final Address address, final SecureCharSequence password) { String title = String.format(LocaliserUtils.getString("check_address_private_key_title"), address .getShortAddress()); Check check = new Check(title, new ICheckAction() { @Override public boolean check() { boolean result = new PasswordSeed(address.getAddress(), address.getFullEncryptPrivKey()).checkPassword(password); if (!result) { try { ECKey eckeyFromBackup = BackupUtil.getEckeyFromBackup( address.getAddress(), password); if (eckeyFromBackup != null) { String encryptPrivateKey = PrivateKeyUtil.getEncryptedString(eckeyFromBackup); if (!Utils.isEmpty(encryptPrivateKey)) { address.recoverFromBackup(encryptPrivateKey); result = true; } eckeyFromBackup.clearPrivateKey(); } } catch (Exception e) { e.printStackTrace(); } finally { password.wipe(); } } return result; } }); return check; }
Example #16
Source File: MonitorAddress.java From bither-desktop-java with Apache License 2.0 | 5 votes |
private void processQrCodeContent(String content) { try { addresses.clear(); java.util.List<Address> wallets = QRCodeEnodeUtil.formatPublicString(content); for (Address address : wallets) { if (!AddressManager.getInstance().getAllAddresses().contains(address)) { addresses.add(address.getAddress()); } } addAddress(wallets); } catch (Exception e) { new MessageDialog(LocaliserUtils.getString("scan_for_all_addresses_in_bither_cold_failed")).showMsg(); } }
Example #17
Source File: WalletUtils.java From bither-desktop-java with Apache License 2.0 | 5 votes |
public static Address findPrivateKey(String address) { for (Address bitherAddressWithPrivateKey : AddressManager.getInstance().getPrivKeyAddresses()) { if (Utils.compareString(address, bitherAddressWithPrivateKey.getAddress())) { return bitherAddressWithPrivateKey; } } return null; }
Example #18
Source File: AbstractAddressProvider.java From bitherj with Apache License 2.0 | 5 votes |
@Override public void addAddress(Address address) { IDb writeDb = this.getWriteDb(); writeDb.beginTransaction(); this.insertAddressToDb(writeDb, address); if (address.hasPrivKey()) { if (!hasPasswordSeed(writeDb)) { PasswordSeed passwordSeed = new PasswordSeed(address.getAddress(), address.getFullEncryptPrivKeyOfDb()); addPasswordSeed(writeDb, passwordSeed); } } writeDb.endTransaction(); }
Example #19
Source File: MonitorAddress.java From bither-desktop-java with Apache License 2.0 | 5 votes |
private void processQrCodeContent(String content) { try { addresses.clear(); java.util.List<Address> wallets = QRCodeEnodeUtil.formatPublicString(content); for (Address address : wallets) { if (!AddressManager.getInstance().getAllAddresses().contains(address)) { addresses.add(address.getAddress()); } } addAddress(wallets); } catch (Exception e) { new MessageDialog(LocaliserUtils.getString("scan_for_all_addresses_in_bither_cold_failed")).showMsg(); } }
Example #20
Source File: ImportPrivateKeyAndroid.java From bither-android with Apache License 2.0 | 5 votes |
private void importPrivateKey(final Address address) { new ThreadNeedService(dp, activity) { @Override public void runWithService(BlockchainService service) { if (address != null) { List<Address> addressList = new ArrayList<Address>(); addressList.add(address); KeyUtil.addAddressListByDesc(service, addressList); ThreadUtil.runOnMainThread(new Runnable() { @Override public void run() { if (dp != null && dp.isShowing()) { dp.setThread(null); dp.dismiss(); } if (activity instanceof HotAdvanceActivity) { ((HotAdvanceActivity) activity).showImportSuccess(); } if (activity instanceof ColdAdvanceActivity) { ((ColdAdvanceActivity) activity).showImportSuccess(); } } }); } } }.start(); }
Example #21
Source File: MenuBar.java From bither-desktop-java with Apache License 2.0 | 5 votes |
private void updateTickerInfo() { new Thread(new Runnable() { @Override public void run() { long finalEstimatedBalance = 0; for (Address address : AddressManager.getInstance().getAllAddresses()) { finalEstimatedBalance = finalEstimatedBalance + address.getBalance(); } if (AddressManager.getInstance().getHdAccount() != null) { finalEstimatedBalance = finalEstimatedBalance + AddressManager.getInstance().getHdAccount().getBalance(); } final long total = finalEstimatedBalance; final String exchange = MarketUtil.getMarketName(UserPreference.getInstance().getDefaultMarket()); final String currency = UserPreference.getInstance().getDefaultCurrency().getName(); final Ticker ticker = MarketUtil.getTickerOfDefaultMarket(); SwingUtilities.invokeLater(new Runnable() { public void run() { updateHeaderOnSwingThread("", total, currency, ticker, exchange); } }); } }).start(); }
Example #22
Source File: SignMessageAddressListActivity.java From bither-android with Apache License 2.0 | 5 votes |
private void initView() { findViewById(R.id.ibtn_back).setOnClickListener( new IBackClickListener(0, R.anim.slide_out_right)); lv = (ListView) findViewById(R.id.lv); flTitleBar = (FrameLayout) findViewById(R.id.fl_title_bar); flTitleBar.setOnClickListener(scrollToTopClick); lv.setAdapter(adapter); switch (signMessageTypeSelect) { case Hot: addresses.clear(); final List<Address> all = AddressManager.getInstance().getPrivKeyAddresses(); addresses.addAll(all); adapter.notifyDataSetChanged(); break; case HdReceive: case BitpieColdReceive: pathType = AbstractHD.PathType.EXTERNAL_ROOT_PATH; loadHdAddress(); break; case HdChange: case BitpieColdChange: pathType = AbstractHD.PathType.INTERNAL_ROOT_PATH; loadHdAddress(); break; } }
Example #23
Source File: HotAddressFragment.java From bither-android with Apache License 2.0 | 5 votes |
@Override public void onCreate(Bundle paramBundle) { super.onCreate(paramBundle); broadcastIntentFilter.addAction(BroadcastUtil.ACTION_MARKET); watchOnlys = new ArrayList<Address>(); privates = new ArrayList<Address>(); hdms = new ArrayList<HDMAddress>(); }
Example #24
Source File: WalletListPanel.java From bither-desktop-java with Apache License 2.0 | 5 votes |
private void addHotAddressList(GridBagConstraints constraints, List<Address> addresses) { synchronized (walletPanels) { for (Address loopPerWalletModelData : addresses) { if (loopPerWalletModelData != null) { JPanel outerPanel = new JPanel(); outerPanel.setOpaque(false); outerPanel.setBorder(BorderFactory.createEmptyBorder(TOP_BORDER, LEFT_BORDER, 0, RIGHT_BORDER)); outerPanel.setLayout(new GridBagLayout()); GridBagConstraints constraints2 = new GridBagConstraints(); constraints2.fill = GridBagConstraints.BOTH; constraints2.gridx = 0; constraints2.gridy = 0; constraints2.weightx = 1.0; constraints2.weighty = 1.0; constraints2.gridwidth = 1; constraints2.gridheight = 1; constraints2.anchor = GridBagConstraints.CENTER; SingleWalletForm singleWalletForm = new SingleWalletForm(loopPerWalletModelData, this); singleWalletForm.getPanel().setComponentOrientation(ComponentOrientation .getOrientation(LocaliserUtils.getLocale())); outerPanel.add(singleWalletForm.getPanel(), constraints2); walletListPanel.add(outerPanel, constraints); walletPanels.add(singleWalletForm); constraints.gridy = constraints.gridy + 1; } } } }
Example #25
Source File: WalletListPanel.java From bither-desktop-java with Apache License 2.0 | 5 votes |
private void addColdAddressList(GridBagConstraints constraints, List<Address> addresses) { synchronized (walletPanels) { for (Address loopPerWalletModelData : addresses) { if (loopPerWalletModelData != null) { JPanel outerPanel = new JPanel(); outerPanel.setOpaque(false); outerPanel.setBorder(BorderFactory.createEmptyBorder(TOP_BORDER, LEFT_BORDER, 0, RIGHT_BORDER)); outerPanel.setLayout(new GridBagLayout()); GridBagConstraints constraints2 = new GridBagConstraints(); constraints2.fill = GridBagConstraints.BOTH; constraints2.gridx = 0; constraints2.gridy = 0; constraints2.weightx = 1.0; constraints2.weighty = 1.0; constraints2.gridwidth = 1; constraints2.gridheight = 1; constraints2.anchor = GridBagConstraints.CENTER; SingleColdWalletFrom coldWalletFrom = new SingleColdWalletFrom(loopPerWalletModelData, this); coldWalletFrom.getPanel().setComponentOrientation(ComponentOrientation .getOrientation(LocaliserUtils.getLocale())); outerPanel.add(coldWalletFrom.getPanel(), constraints2); walletListPanel.add(outerPanel, constraints); walletPanels.add(coldWalletFrom); constraints.gridy = constraints.gridy + 1; } } } }
Example #26
Source File: DialogSelectChangeAddress.java From bither-android with Apache License 2.0 | 5 votes |
public DialogSelectChangeAddress(Context context, Address fromAddress) { super(context); this.fromAddress = fromAddress; this.changeAddress = fromAddress; setContentView(R.layout.dialog_select_change_address); fl = (FrameLayout) findViewById(R.id.fl); lv = (ListView) findViewById(R.id.lv); lv.setAdapter(adapter); }
Example #27
Source File: AddressProvider.java From bither-android with Apache License 2.0 | 5 votes |
@Override protected void insertAddressToDb(IDb db, Address address) { AndroidDb mdb = (AndroidDb)db; ContentValues cv = new ContentValues(); cv.put(AbstractDb.AddressesColumns.ADDRESS, address.getAddress()); if (address.hasPrivKey()) { cv.put(AbstractDb.AddressesColumns.ENCRYPT_PRIVATE_KEY, address.getEncryptPrivKeyOfDb()); } cv.put(AbstractDb.AddressesColumns.PUB_KEY, Base58.encode(address.getPubKey())); cv.put(AbstractDb.AddressesColumns.IS_XRANDOM, address.isFromXRandom() ? 1 : 0); cv.put(AbstractDb.AddressesColumns.IS_SYNCED, address.isSyncComplete() ? 1 : 0); cv.put(AbstractDb.AddressesColumns.IS_TRASH, address.isTrashed() ? 1 : 0); cv.put(AbstractDb.AddressesColumns.SORT_TIME, address.getSortTime()); mdb.getSQLiteDatabase().insert(AbstractDb.Tables.Addresses, null, cv); }
Example #28
Source File: PrivateKeyUtil.java From bitherj with Apache License 2.0 | 5 votes |
public static List<Address> getECKeysFromBackupString(String str, CharSequence password) { String[] strs = QRCodeUtil.splitOfPasswordSeed(str); if (strs.length % 3 != 0) { log.error("Backup: PrivateKeyFromString format error"); return null; } ArrayList<Address> list = new ArrayList<Address>(); for (int i = 0; i < strs.length; i += 3) { if (strs[i].indexOf(QRCodeUtil.HDM_QR_CODE_FLAG) == 0) { continue; } if (strs[i].indexOf(QRCodeUtil.HD_QR_CODE_FLAG) == 0){ continue; } String encryptedString = strs[i] + QRCodeUtil.QR_CODE_SPLIT + strs[i + 1] + QRCodeUtil.QR_CODE_SPLIT + strs[i + 2]; ECKey key = getECKeyFromSingleString(encryptedString, password); if (key == null) { return null; } else { Address address = new Address(key.toAddress(), key.getPubKey(), encryptedString, false, key.isFromXRandom()); key.clearPrivateKey(); list.add(address); } } return list; }
Example #29
Source File: MenuBar.java From bither-desktop-java with Apache License 2.0 | 5 votes |
private void updateTickerInfo() { new Thread(new Runnable() { @Override public void run() { long finalEstimatedBalance = 0; for (Address address : AddressManager.getInstance().getAllAddresses()) { finalEstimatedBalance = finalEstimatedBalance + address.getBalance(); } if (AddressManager.getInstance().getHdAccount() != null) { finalEstimatedBalance = finalEstimatedBalance + AddressManager.getInstance().getHdAccount().getBalance(); } final long total = finalEstimatedBalance; final String exchange = MarketUtil.getMarketName(UserPreference.getInstance().getDefaultMarket()); final String currency = UserPreference.getInstance().getDefaultCurrency().getName(); final Ticker ticker = MarketUtil.getTickerOfDefaultMarket(); SwingUtilities.invokeLater(new Runnable() { public void run() { updateHeaderOnSwingThread("", total, currency, ticker, exchange); } }); } }).start(); }
Example #30
Source File: ColdAddressFragment.java From bither-android with Apache License 2.0 | 5 votes |
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_cold_address, container, false); view.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { FileUtil.getBackupFileListOfCold(); FileUtil.getBackupFileOfCold(); } }); lvPrivate = (ListView) view.findViewById(R.id.lv_address); ivNoAddress = view.findViewById(R.id.iv_no_address); privates = new ArrayList<Address>(); mAdapter = new AddressOfColdFragmentListAdapter(getActivity(), privates, this); lvPrivate.setAdapter(mAdapter); if (AbstractApp.addressIsReady) { List<Address> ps = AddressManager.getInstance().getPrivKeyAddresses(); if (ps != null) { privates.addAll(ps); mAdapter.notifyDataSetChanged(); } } return view; }