This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
3
How can I initialize a variable within a listener and keep it's data outside the listener?
Post Body
I have a simple OnDateSetListener for a calender, and within the listener I set a var called "birthdate" to the inputted date. I then want to use that date outside of the listener, but I can't find anything that explains it. I tried creating the var outside the listener rather than inside like so:
var birthDate : Date
and then initializing it on the inside of the listener:
birthDate = birth
but then my println outside the listener still says its not initialized. How can I keep the data even outside the listener?
Post Details
We try to extract some basic information from the post title. This is not
always successful or accurate, please use your best judgement and compare
these values to the post title and body for confirmation.
- Posted
- 4 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/Kotlin/comm...