I am using ethLogFlowable to subscribe to an event and read the args of the event, in my case an address and a uint256 value.
I have followed this answer stackExchangeLink, but I am always getting only one element from topics which is the my-event-hash.
Here is my code:
filter.addSingleTopic(my_event_hash);
MainActivity.web3j.ethLogFlowable(filter).subscribe(log -> {
System.out.println("Event equal "+log);
Address arg1 = (Address) FunctionReturnDecoder.decodeIndexedValue(log.getTopics().get(1), new TypeReference<Address>() {});
System.out.println("----ARG1: "+arg1);
});
The application crash as log.getTopics
contains only one element hash_event
Any idea? please.