SteveTerrell Active Member Licensed User Longtime User Jan 22, 2014 #1 In an Activity it is possible to use Activity.ACTION_DOWN etc. to compare with MotionEvent actions and avoid having to use the values for those actions. How can this be done in a class? Me.ACTION_DOWN does not work Steve
In an Activity it is possible to use Activity.ACTION_DOWN etc. to compare with MotionEvent actions and avoid having to use the values for those actions. How can this be done in a class? Me.ACTION_DOWN does not work Steve
Erel B4X founder Staff member Licensed User Longtime User Jan 22, 2014 #2 You can pass the Activity object to a class. However it will be simpler to just use these constants instead: B4X: Private ACTION_UP = 1, ACTION_MOVE = 2, ACTION_DOWN = 0 As Int Upvote 0
You can pass the Activity object to a class. However it will be simpler to just use these constants instead: B4X: Private ACTION_UP = 1, ACTION_MOVE = 2, ACTION_DOWN = 0 As Int
SteveTerrell Active Member Licensed User Longtime User Jan 22, 2014 #3 Erel said: You can pass the Activity object to a class. However it will be simpler to just use these constants instead: B4X: Private ACTION_UP = 1, ACTION_MOVE = 2, ACTION_DOWN = 0 As Int Click to expand... As usual, thanks for the quick reply. I now have a different question, but related to your answer. If I store an instance of a class in a map or list will each stored instance include a set of the above constants (if I use the Private int approach)? Steve Upvote 0
Erel said: You can pass the Activity object to a class. However it will be simpler to just use these constants instead: B4X: Private ACTION_UP = 1, ACTION_MOVE = 2, ACTION_DOWN = 0 As Int Click to expand... As usual, thanks for the quick reply. I now have a different question, but related to your answer. If I store an instance of a class in a map or list will each stored instance include a set of the above constants (if I use the Private int approach)? Steve
Erel B4X founder Staff member Licensed User Longtime User Jan 23, 2014 #4 Yes. However unless you are storing more than 100k instances you shouldn't be worried about these 3 ints. Upvote 0
Yes. However unless you are storing more than 100k instances you shouldn't be worried about these 3 ints.
SteveTerrell Active Member Licensed User Longtime User Jan 23, 2014 #5 Erel said: Yes. However unless you are storing more than 100k instances you shouldn't be worried about these 3 ints. Click to expand... Only 3600 instances so no worries Upvote 0
Erel said: Yes. However unless you are storing more than 100k instances you shouldn't be worried about these 3 ints. Click to expand... Only 3600 instances so no worries