You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just a humble suggestion...
The logic in BetterAsyncTask checks the passed-in Context to determine if it's a BetterActivity. It uses that info for only two purposes, both of which appear to be candidates for elimination:
The progress dialog is only shown if the Context is a BetterActivity, but that seems overly restrictive because it doesn't rely on the BetterActivity interface. It does assume that dialog ID 0 will be available if the activity is a BetterActivity, but I think a sensible default behavior would be to make the default dialog ID be -1 instead of 0. I guess there's some default "fall-through" behavior in the BetterActivity implementations for handling dialog ID 0, but I'm not sure that really is worth it.
It's also used to check the window features of the passed-in activity, but the default implementation of BetterActivity.getWindowFeatures() just calls BetterActivityHelper, which BetterAsyncTask could call directly itself. Furthermore, BetterActivityHelper.getWindowFeatures()'s comments indicate that it's broken anyway.
It seems to me that if these checks for BetterActivity were eliminated, BetterAsyncTask would be more useful for use from non-BetterActivity activities.
The text was updated successfully, but these errors were encountered:
Just a humble suggestion...
The logic in BetterAsyncTask checks the passed-in Context to determine if it's a BetterActivity. It uses that info for only two purposes, both of which appear to be candidates for elimination:
The progress dialog is only shown if the Context is a BetterActivity, but that seems overly restrictive because it doesn't rely on the BetterActivity interface. It does assume that dialog ID 0 will be available if the activity is a BetterActivity, but I think a sensible default behavior would be to make the default dialog ID be -1 instead of 0. I guess there's some default "fall-through" behavior in the BetterActivity implementations for handling dialog ID 0, but I'm not sure that really is worth it.
It's also used to check the window features of the passed-in activity, but the default implementation of BetterActivity.getWindowFeatures() just calls BetterActivityHelper, which BetterAsyncTask could call directly itself. Furthermore, BetterActivityHelper.getWindowFeatures()'s comments indicate that it's broken anyway.
It seems to me that if these checks for BetterActivity were eliminated, BetterAsyncTask would be more useful for use from non-BetterActivity activities.
The text was updated successfully, but these errors were encountered: