A digital guide to accompany the Google Developer Group Android Study Jam
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
@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.
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)?
@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)
Ok, thank you
@ivan94@nitya I took a quick look at this issue last night and I realized that I was getting the same behavior at one point. The way I "fix" it (still feels buggy, sometimes the share icon shows but it does not respond to click events) was using Intent.FLAG_ACTIVITY_NEW_DOCUMENT instead of FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET. FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET is deprecated in API level 21.
@lockerfish thanks! @ivan94 did this help? Let us know..
I'm having trouble completing Lesson 4B. After making the changes required for the "Inserts with ContentProvider" quiz, the tests start to fail. >> android.database.sqlite.SQLiteReadOnlyDatabaseException: attempt to write a readonly database (code 1032) << After hours of trying different things, I decided to pull their code from GitHub (the 4.16 branch). I was surprised to see that code failed as well, in exactly the same way. Does this code work for you at all?
Hey David .. Will check it out tonight. They changed codebases recently so I haven't tried out updates yet but will verify this and then update you or them as appropriate
@Polymath-Z they missed to close the database in some cases in WeatherProvider... Try adding db.close(); before returning.
@lockerfish Thanks for the advice! Although the instructor notes specifically say "Please do not have db.close statements in your content provider," the tests will fail unless I call db.close() in those methods.
@nitya@lockerfish I tried it but still buggy. I do not know if it changed the behavior is some specific case but overall still behaving the same with the new flag. I tried to check the share_history.xml but I don't know how to do it. If i'm right the file is created on the private app storage space and I can't read it from adb shell or the device monitor. How do I look at the file? Do I need to open it on the app and log the contents? if that's the case I need to know the app data folder structure and where the file is located.
@nitya I see you merged my pull request for lesson-6 but the book didn't rebuild. Services and Notifications is missing the changes.
@john ..really. I'll force an update. You should have direct commit access too right?
@nitya I think i do but wanted practice on using pull requests - thats why i do it that way
@john aha.. No worries then. I'll push an update first thing tomorrow and it should trigger a rebuild.
@nitya thanks...it is just weird...you merged in 3 of my pull requests back to back...it was just the last one that didn't trigger a rebuild
@johnshea yes that was weird. Forced a rebuild (and also put a note — looks like the Sunshine-Version-2 github repo disappeared so for now will leave it with 1.0 links)
Hi @nitya, as promised I have a question: The app up until lesson 5, fetch weather data from the server whenever the refresh button is pressed. It fetches the data and stores it. I don't see anywhere in the code they deleting this data, just storing. If I press the refresh button more than once in an interval small enough that the data from the server is the same in all those refreshes, the database will get some "duplicate" rows. On the Loader query we set the sortOrder to sort the data by the date, so in my view it should show some duplicate data as response right? for example if I have 3 identical forecasts for tomorrow among the data in the database, when I query sorting by date I should get all this data together. But that does not happen. So my question is why i'm not getting duplicate data on the forecast list?
hey anyone has idea on getting context in a non activity class
without passing parameters everytime while calling a function
@yashthakur1 it depends on the the type of stuff you need to preserve in your context. The way I typically think about it is if it is stuff related to the lifecycle of an activity then use Activity Context otherwise use Application Context. Application context is there for the lifetime of the app. So, it survives activity lifecycle probably that's what you need. As a side note, don't keep presumably memory leaky stuff.
in your Application Context.. keep it lightweight.
how to create a navigation drawer in empty activity
Hi , I'm working on Bluetooth low energy, I need a help on this
how to work with media player using service
anybody has a genymotion alternative
@yashthakur1 you want emulator?
hey i am new android
plz help i want if i want buil a call recording is kotlin is sufficient
is this android exclusive or monaca/cordova android
I have made contribution still I am unable to join organisation
please someone invite me
I have to join organisation
I have a question. How do i hard reset my lg k7 metropcs phone?
i am starting a startup any one want to join for android developers