how to create random UUID in Android when button click event happens?
You are explicitly avoiding the new UUID creation by:
if(uniqueId == null) {
uniqueId = UUID.randomUUID().toString();
}
Remove the check.
First time it intialise the variable and next time when you click button it doesn't get null value
Remove if condition from this
if(uniqueId == null) {
uniqueId = UUID.randomUUID().toString();
}
Use this
uniqueId = UUID.randomUUID().toString();