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
Timob 6101: Android: Contacts: Rhino/v8, get image from picker does not display an image #778
Conversation
…e into timob-6101
…e into timob-6101
…e into timob-6101
…e into timob-6101
…e into timob-6101
…e into timob-6101
Activity launchingActivity = TiApplication.getInstance().getRootActivity(); | ||
Activity launchingActivity = TiApplication.getInstance().getCurrentActivity(); | ||
if (launchingActivity == null) { | ||
Log.d(LCAT, "Couldn't showContacts, current activity is null."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe use "error" level for log here.
Functional tested. Accepted Device: Xoom (Android 3.2.1) |
Cursor cursor = TiApplication.getInstance().getCurrentActivity().managedQuery( | ||
Activity rootActivity = TiApplication.getInstance().getRootActivity(); | ||
if (rootActivity == null) { | ||
rootActivity = TiApplication.getInstance().getCurrentActivity(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a null check for the return from getCurrentActivity as this can be null.
Not sure from a terminology standpoint what makes the most sense, but in the modified files we now use rootActivity as a variable to reference activities other than our TiRootActivity instance which is slightly confusing. While not holding up this PR, it might be worthwhile to change that to something a bit more clear. |
Perhaps adding a private method (ex: getActivity()) that returns the activity we then use to execute the query. |
…e into timob-6101
…ull check for TiApplication to ContactsModule and ContactsApiLevel5
…e into timob-6101
Code reviewed and function tested. Accepted. |
Uri uri = ContentUris.withAppendedId(ContactsUri, id); | ||
ContentResolver cr = TiApplication.getInstance().getCurrentActivity().getContentResolver(); | ||
ContentResolver cr = TiApplication.getInstance().getContentResolver(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't need to be within the scope of this request, but we might consider adding geContentResolver() as a static method on TiApplication so we can wrap the getInstance() check in a single place much like was done with getRootOrCurrentActivity().
Code review accepted. +1 Opie's comment re |
Code reviewed and Accepted. Merging |
Timob 6101: Android: Contacts: Rhino/v8, get image from picker does not display an image
Jira http://jira.appcelerator.org/browse/TIMOB-6101
To test it: