Android Question DraggableView Class - More Questions

mjtaryan

Active Member
Licensed User
Longtime User
To summarize, I am working on an activity that is a puzzle. The puzzle is solved when all the "pieces" (panels) are in the proper order. The puzzle is set up in the activity that uses the DraggableView class. Once this is done, the app waits for an event that moves a piece. Everything else is done by the DraggableView class module (moving the piece, updating those variables that need to be updated with each move - such as the piece's new location and determining if the puzzle is solved). All that is working as it should.

However, what is supposed to happen is that when the puzzle is solved, the player receives a congratulatory message (using one of the Msgbox routines) and, when the dialog box is closed, the puzzle activity is to start a new ("reward") activity and close itself. My problem is I can't figure out how to accomplish this. The only way the "reward" activity starts is by tapping the device's Back button.

I tried calling the "reward" activity from the DraggableView class module (which doesn't work) and from the puzzle activity's "Create", "Resume" and "Pause" subs. The only one that works is "Pause" and then only when Back is tapped. Therefore, to more fully understand how this is working and to get the app to do what is supposed to happen, I have some questions.

1. Obviously, how do I trap the puzzle's solution in the puzzle activity so as to activate the "reward" activity only when the puzzle is solved?
2. The DraggableView class module "Touch" event returns a value of True. To what and where is this value being returned?
3. In between Touch events, where in the code is the device paused?
4. Can an event sub be used in the puzzle's activity that is triggered when the puzzle's solution is True? If so, how?

Hopefully, this will be the last issue in connection with the DraggableView class. Thanks.
 

mjtaryan

Active Member
Licensed User
Longtime User
I think I've answered at least the first of my questions above. While waiting for a reply, I added a Timer to the Puzzle activity that checks the value of the puzzle solution flag. If the puzzle hasn't been solved, the timer is restarted. If the puzzle has been solved, the "reward" activity is started and the puzzle actiivty is closed. I tested this and it works. Sorry I wasted your time. Had I been able to delete my original post, I would have done so. Thanks.
 
Upvote 0
Top