I have a custom view that has a slider in it. From inside the view, onSomeSlideDistance I launch an activity. So my design is ActivityOne => ListView => Adapter => CustomView => [sliding: intent] => ActivityTwo
.
Now my problem is this:
When the sliding action starts ActivityTwo, I need it to stay open (i.e. slid) until after ActivityTwo starts. But if user clicks to finish() ActivityTwo, when control returns to ActivityOne I need the slider to have reset. How do I accomplish this?
what have I tried?
I tried using a handler inside CustomView, but even when I use postDelayed and put the handler code after startActivity, the handler code still executes before ActivityTwo is started.
I tried using a inner activity inside CustomView and then from inside the inner activity call startActivityForResult(ActivityTwo.class,CODE), but this throws all sorts of errors as I tried different configurations for it.
At some point I also tried a delayed runnable in new Thread from within CustomView; so that it would run after ActivityTwo starts, then I get error about only activity can change its views.