These are chat archives for gdg-hudson-valley/android-guide

19th
Feb 2015
Ivan Fernandes
@ivan94
Feb 19 2015 03:37
@nitya Do you remember our discussion about the share button on the last meeting? When I was using the app today I realized that it must not be behaving the way it should... I captured my screen to show you: https://www.youtube.com/watch?v=pkmduwwe7-8
Just to describe the actions: I first enter the app, go to the Detail page. The share button shows the list ordered by my last uses. I click to share by twitter, press the back button and twitter is showing on the last used share option. When I click the share button again the twitter icon suddenly disappears (different behavior than the first time), I close and click again and twitter is on the top of my list
Ivan Fernandes
@ivan94
Feb 19 2015 03:43
After that I go back to the ListView, enter again to the details page and now the list on the share button do not have any order whatsoever. I close the app, remove from the memory, and then when I launch the app again and go to the details page it shows the list ordered again, including the twitter app
Nitya Narasimhan
@nitya
Feb 19 2015 14:14
@ivan94 — this is interesting (and a terrific question!) I am going to try out the sequence of actions on my local app and see what my behavior is. If you have your code on GitHub let me know and I can build that version and see as well. So one thing that would be interesting to see is what the persisted ShareAction history is, and understand how it changes based on various actions you’ve shown above. See http://developer.android.com/guide/topics/ui/actionbar.html#ActionProvider — there is a file (name provided by the DEFAULT_SHARE_HISTORY_FILE_NAME attribute) which stores the history of share actions, which is effectively what the SAP uses when reordering that list. I’m curious to see what the values in that are, after each action you outline. It should default to “share_history.xml” (though you can change it). If for any reason that is null, then the history does not get persisted across sessions I believe. The bottom line is that the ShareActionProvider uses the contents of this file to recreate the order in the menu, so somewhere something is not being written or read correctly from it. That’s my guess. If you find out differently, do post back here so I can update my FAQ as well.
Ivan Fernandes
@ivan94
Feb 19 2015 16:18
Ivan Fernandes
@ivan94
Feb 19 2015 16:23
And an unrelated question: For the next week are we expected to finish only lesson 4A or all the 4 lessons (A, B and C)?
Nitya Narasimhan
@nitya
Feb 19 2015 19:33
@ivan94 - will look at this later tonight when I get back. Re next week: They just recently split this into 4a/4b/4c — so we can target 4a for this week (and folks get 4b and 4c done, that’s good - but we will cover these in the next week)
Ivan Fernandes
@ivan94
Feb 19 2015 21:51
Ok, thank you