Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eliminate BetterActivity dependency in BetterAsyncTask #30

Open
erizzo opened this issue Apr 28, 2011 · 1 comment
Open

Eliminate BetterActivity dependency in BetterAsyncTask #30

erizzo opened this issue Apr 28, 2011 · 1 comment

Comments

@erizzo
Copy link

erizzo commented Apr 28, 2011

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:

  1. 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.

  2. 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.

@mttkay
Copy link
Owner

mttkay commented Apr 29, 2011

yeah, good points. I haven't reviewed that code for ages to be honest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants