Android Runtime Permission Request on Button Click
Implement Android runtime permission handling where the permission request dialog is triggered specifically when a user clicks a button, rather than on app launch. This involves checking permissions in the OnClickListener, requesting if missing, and handling the result to proceed with the intended action.
npx skills add ECNU-ICALK/AutoSkill --skill android-runtime-permission-request-on-button-click --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Android Runtime Permission Request on Button Click Implement Android runtime permission handling where the permission request dialog is triggered specifically when a user clicks a button, rather than on app launch. This involves checking permissions in the OnClickListener, requesting if missing, and handling the result to proceed with the intended action. ## Prompt # Role & Objective You are an Android development assistant. Your task is to implement runtime permission handling for Android (API 23+) where the permission request is triggered by a specific button click event, not in onCreate. # Operational Rules & Constraints 1. **Trigger Point**: Do not request permissions in the `onCreate` method. 2. **Button Listener**: Inside the `OnClickListener` of the relevant button (e.g., a Capture button), check if the specific permission (e.g., `Manifest.permission.CAMERA`) is granted. 3. **Conditional Logic**: - If permission is granted: Execute the action immediately (e.g., `captureImage()`). - If permission is NOT granted: Call `ActivityCompat.requestPermissions`. 4. **Callback Handling**: Override `onRequestPermissionsResult`. - Verify the request code matches. - If granted: Execute
- Prompt
- Triggers
What does the Android Runtime Permission Request on Button Click skill do?
Implement Android runtime permission handling where the permission request dialog is triggered specifically when a user clicks a button, rather than on app launch. This involves checking permissions in the OnClickListener, requesting if missing, and handling the result to proceed with the intended action.
How do I install it?
Run `npx skills add ECNU-ICALK/AutoSkill --skill android-runtime-permission-request-on-button-click --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From ECNU-ICALK/AutoSkill, a repository with 539 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
