Hi there,
I have quite a difficult problem here. I attatched a little project, which shows what happens.
I have a data class (called DataContainer here), where the instances are distributed between different activities. Some of the methods are using UI features. These features need the activity to be active, which instantiated the class... so this failes when the class instance is used by another activity.
That's why I created a little helper class (called DataHelper). An instance of this class is instantiated in the activity which uses the data class and given to the method which uses the UI.
That looks quite complicated, but it's necessary in my app, since otherwise I had to make a bunch of callbacks and duplicate much code in every activitiy.
And that works.
Now the method which uses the UI (and is located in the helper class) has to be a resumable sub. So the method of the data class hat to be resumable, too.
An here I have a problem:
I can call the data call method which calls the helper class method. The InputList is shown, I can select an item. The helper class method seems to return (the log is shown), but the data class method never completes the Wait For statement.
Why? What have I done wrong?
I have quite a difficult problem here. I attatched a little project, which shows what happens.
I have a data class (called DataContainer here), where the instances are distributed between different activities. Some of the methods are using UI features. These features need the activity to be active, which instantiated the class... so this failes when the class instance is used by another activity.
That's why I created a little helper class (called DataHelper). An instance of this class is instantiated in the activity which uses the data class and given to the method which uses the UI.
That looks quite complicated, but it's necessary in my app, since otherwise I had to make a bunch of callbacks and duplicate much code in every activitiy.
And that works.
Now the method which uses the UI (and is located in the helper class) has to be a resumable sub. So the method of the data class hat to be resumable, too.
An here I have a problem:
I can call the data call method which calls the helper class method. The InputList is shown, I can select an item. The helper class method seems to return (the log is shown), but the data class method never completes the Wait For statement.
Why? What have I done wrong?