onCoinsReceived not triggering.

24 views
Skip to first unread message

Bobby_Bouche

unread,
Jun 14, 2019, 9:34:07 AM6/14/19
to bitcoinj
i got this so far.

its not triggering the settext at all. is there something special i have to do?

MainPage.BTCkit.wallet().addCoinsReceivedEventListener(new WalletCoinsReceivedEventListener() {
@Override
public void onCoinsReceived(Wallet w, Transaction tx, Coin prevBalance, Coin newBalance) {
TextView tVStatus = (TextView)findViewById(R.id.tVStatus);
tVStatus.setText("Testing");
}
});

Bobby_Bouche

unread,
Jun 14, 2019, 10:37:30 AM6/14/19
to bitcoinj
ok so it does after a long and unpredictable time. do i need to throw this in a new thread or something o.0?

Bobby_Bouche

unread,
Jun 16, 2019, 2:21:25 PM6/16/19
to bitcoinj
bump.


On Friday, June 14, 2019 at 9:34:07 AM UTC-4, Bobby_Bouche wrote:

Andreas Schildbach

unread,
Jun 17, 2019, 5:56:33 AM6/17/19
to bitc...@googlegroups.com
I assume you've registered the listener.

The callback should fire immediately after bitcoinj first learns of an
incoming transaction, either by unconfirmed broadcast or by block (if it
missed the broadcast).

Generally it's a good idea to *not* do a lot of work in your callack,
however your line below should be fine.

As always, have a look at the log. I suggest to add some logging in your
callback too to assess if it really fires "after a long and
unpredictable time".
> --
> You received this message because you are subscribed to the Google
> Groups "bitcoinj" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to bitcoinj+u...@googlegroups.com
> <mailto:bitcoinj+u...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/bitcoinj/bff68e67-4c57-485b-b4b4-57a1a2334595%40googlegroups.com
> <https://groups.google.com/d/msgid/bitcoinj/bff68e67-4c57-485b-b4b4-57a1a2334595%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.


Bobby_Bouche

unread,
Jun 18, 2019, 12:31:08 PM6/18/19
to bitcoinj
Hi andreas thanks for your response. Yes it works but i have to tap my "Overview" button on my android device. It then removes the focus on the activity and views all my recent activities. So when i tap on it to get back to the activity i was working on it works instantly.

recapping. I go through the process, generate the QRCode use my testnet client to send the amount to my app. Nothing changes, hit overview then tap on my app and boom instalt yupdates it. Is there something blocking it? Do i have to throw this in a thread? I dont understand why i have to leave the activity and get back into it again just for it to update.
Reply all
Reply to author
Forward
0 new messages