user53059: I'm implementing an app using BitcoinJ, but every time I run the code, a new address is created. Is there any way to work with the very first address that was created and stop creating new addresses?
walletAppKit = new WalletAppKit(parameters, walletDir, "my_wallet") {
        @Override
        protected void onSetupCompleted() {

        if (wallet().getImportedKeys().size() < 1) 
           wallet().importKey(new ECKey());
           walletAppKit.peerGroup().setBloomFilterFalsePositiveRate(0.00001);
           setupWalletListeners(wallet());

           for (Address address: wallet().getIssuedReceiveAddresses()){
                Log.d("myLogs", address.toBase58());
           }
        }
    };
walletAppKit.setBlockingStartup(false);
walletAppKit.setUserAgent("RocketWallet", "1.0");
walletAppKit.startAsync();


user81115: According to the documentation:

getImportedKeys() returns a list of the non-deterministic keys that
  have been imported into the wallet, or the empty list if none.

Try to change:
if (wallet().getImportedKeys().size() < 1)
    wallet().importKey(new ECKey());

to:
if (wallet().getIssuedReceiveKeys().size() < 1)
    wallet().freshReceiveKey();

To get the first address in your wallet, you can use:
wallet.getIssuedReceiveKeys().get(0).toAddress(TestNet3Params.get()).toBase58().toString();


53059: <p>I'm implementing an app using BitcoinJ, but every time I run the code, a new address is created. Is there any way to work with the very first address that was created and stop creating new addresses?</p>

<pre><code>walletAppKit = new WalletAppKit(parameters, walletDir, "my_wallet") {
        @Override
        protected void onSetupCompleted() {

        if (wallet().getImportedKeys().size() &lt; 1) 
           wallet().importKey(new ECKey());
           walletAppKit.peerGroup().setBloomFilterFalsePositiveRate(0.00001);
           setupWalletListeners(wallet());

           for (Address address: wallet().getIssuedReceiveAddresses()){
                Log.d("myLogs", address.toBase58());
           }
        }
    };
walletAppKit.setBlockingStartup(false);
walletAppKit.setUserAgent("RocketWallet", "1.0");
walletAppKit.startAsync();
</code></pre>
 81115: <p>According to the <a href="https://bitcoinj.github.io/javadoc/0.14.2/index.html?org/bitcoinj/wallet/Wallet.html" rel="nofollow noreferrer">documentation</a>:</p>

<blockquote>
  <p>getImportedKeys() returns a list of the non-deterministic keys that
  have been imported into the wallet, or the empty list if none.</p>
</blockquote>

<p>Try to change:</p>

<pre><code>if (wallet().getImportedKeys().size() &lt; 1)
    wallet().importKey(new ECKey());
</code></pre>

<p>to:</p>

<pre><code>if (wallet().getIssuedReceiveKeys().size() &lt; 1)
    wallet().freshReceiveKey();
</code></pre>

<p>To get the first address in your wallet, you can use:</p>

<pre><code>wallet.getIssuedReceiveKeys().get(0).toAddress(TestNet3Params.get()).toBase58().toString();
</code></pre>
