2d
awarded Constituent
Apr
15
revised Handler vs AsyncTask vs Thread
added 813 characters in body
Apr
15
answered Handler vs AsyncTask vs Thread
Apr
13
awarded Caucus
Apr
8
comment Terminology: How to speak about pointers and references in Java
@cy3er Then, since in Java a reference is an object that points to / references another object, the word pointer could just be discarded, but if used, it can be used interchangeably with the word reference?
Apr
8
revised Terminology: How to speak about pointers and references in Java
added 116 characters in body
Apr
8
comment Terminology: How to speak about pointers and references in Java
@cy3er So the word pointer isn't used in Java?
Apr
8
revised Terminology: How to speak about pointers and references in Java
added 219 characters in body
Apr
8
comment Terminology: How to speak about pointers and references in Java
So I can speak feely about references and pointers using the meaning I learned while learning C/C++ and rest assured that Java developers are picking up the same meaning I'm putting into it?
Apr
8
comment Terminology: How to speak about pointers and references in Java
Yes, I forgot to exclude primitives, thanks for pointing this out. But leaving them aside, I think you know what I mean. So you're calling them pointers? Is it really a pointer or is it a copy of the Java Object which points to the class' instance? In C it would be a 32/64 bit address which gets copied.
Apr
8
asked Terminology: How to speak about pointers and references in Java
Apr
8
accepted In a ViewHolder's View with a Listener, how to modify the data it represents?
Apr
8
comment In a ViewHolder's View with a Listener, how to modify the data it represents?
So I should store the reference in the tag of the widget in question? Sounds interesting, will think about this.
Apr
8
comment In a ViewHolder's View with a Listener, how to modify the data it represents?
Oh, so you mean that even multiple views of the same type should share the same listener? And the reference to the data the listener should be acting upon should be stored where?
Apr
8
comment In a ViewHolder's View with a Listener, how to modify the data it represents?
It works, but I don't know If it is more of a kludge rather than the appropiate solution. On the other hand, there should be a solution which groups the listener with the corresponding data, where the listener get's swapped out in the onBindViewHolder() so that it doesn't get GC'd when not in use. Then the listener would need to have a reference to the data it is acting upon, kind of like a closure. So new Listener would only get called once per dataset.
Apr
8
comment In a ViewHolder's View with a Listener, how to modify the data it represents?
Yes I thought about this, but it didn't seem right to set a new listener on every onBindViewHolder() call as the older ones would need to get GC'd afterwards. I'm currently setting it in the onCreateViewHolder(), and I've added an Object member variable to the ViewHolder which contains a reference to the corresponding which changes between every onBindViewHolder(), together with the view's "looks". My question is if it is OK to use such a variable in a ViewHolder, or if one shouldn't use that approach. (cont)
Apr
7
revised In a ViewHolder's View with a Listener, how to modify the data it represents?
added 12 characters in body
Apr
7
comment In a ViewHolder's View with a Listener, how to modify the data it represents?
@Stan I'm using a RecyclerView.ViewHolder which apparently replaced getView() by onCreateViewHolder(). I'm already setting up the Listener in this method. The point is that the dataset which the displayed slider is acting upon changes as the views get recycled. I'm asking about which method is appropiate in order to have the ViewHolder know which dataset is currently associated to the Listener.
Apr
7
asked In a ViewHolder's View with a Listener, how to modify the data it represents?
Apr
7
awarded Tumbleweed
1 2 3 4 5