We hardcode many request codes (for PendingIntent, onRequestPermissionsResult, etc), but we can take advantage of resources to generate unique codes for us. ID resources can be used whereever we need a unique integer.
res/values/ids.xml file.<item name="{request-code-name}" type="id"/>) for each request code.strings.xml files).REQUEST_CODE_PROMPT_PERMISSIONS with R.id.permissions_prompt_request_code)I would like to try this if its still available
In progress
Hey,
There are more hard-coded values along with the request codes like custom_tab_session_id, shared_transition_ms etc. I don't have to include them?
No, only include the values where a static random integer makes sense. shared_transition_ms should always be the same number of milliseconds, and custom_tab_session_id needs to a random UUID string for different tabs.
ok
Hello,
I have done this but i can't push the branch I created as I don't have access. How do I push my changes and create a PR? :'D Sorry, a noob here
Here's a tip:
mozilla-mobile/fenix to <your GitHub username>/fenix<your GitHub username/fenix repository (e.g. git remote add origin https://github.com/<your username>/fenix.git)git clone https://github.com/<your username>/fenix.git is already enoughgit add * then git commit -m "Commit message here")git push origin master)mozilla-mobile/fenix ⬅️ <your GitHub username>/fenix)There's always a bunch of online how-tos and demos on Git and GitHub during Hacktoberfest, such as:
Note that many of those tutorials refer to Git CLI (command-line) instead of GUI (graphical) equivalents such as Git GUI and GitHub Desktop. The Git CLI is accessible from the Command Prompt / Terminal once after installing Git from the official website
git push origin master is giving me Permission to mozilla-mobile/fenix.git denied to Apoorv-Gaurav-Agarwal.
I have created PR but they got created separately for the edited files ;-;
Ok. I did it in a single pull request. I have closed the prior ones.
Thanks for the help
Thanks so much for the detailed PR guide @reinhart1010!
Unfortunately we have to close this issue, this change is causing crashes when the generated ID has more than 16 bits. (mozilla-mobile/android-components#4854)
Most helpful comment
Here's a tip:
mozilla-mobile/fenixto<your GitHub username>/fenix<your GitHub username/fenixrepository (e.g.git remote add origin https://github.com/<your username>/fenix.git)EDIT: using
git clone https://github.com/<your username>/fenix.gitis already enoughgit add *thengit commit -m "Commit message here")git push origin master)mozilla-mobile/fenix⬅️<your GitHub username>/fenix)There's always a bunch of online how-tos and demos on Git and GitHub during Hacktoberfest, such as:
Note that many of those tutorials refer to Git CLI (command-line) instead of GUI (graphical) equivalents such as Git GUI and GitHub Desktop. The Git CLI is accessible from the Command Prompt / Terminal once after installing Git from the official website