Commit 518933d
authored
Refactor onActivityResult() method to handle NullPointerExceptions (#1117)
This commit rewrites the onActivityResult() method in order to handle
possible NullPointerExceptions that can occur when accessing data.getData().
The changes include adding try-catch blocks to handle exceptions gracefully
and prevent app crashes. Additionally, comments have been added to the method
to explain what each block of code is doing.1 parent 771b804 commit 518933d
File tree
1 file changed
+18
-7
lines changed- app/src/main/java/swati4star/createpdf/fragment
1 file changed
+18
-7
lines changedLines changed: 18 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
114 | 121 | | |
115 | 122 | | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
116 | 126 | | |
117 | 127 | | |
| 128 | + | |
118 | 129 | | |
119 | 130 | | |
120 | 131 | | |
| |||
205 | 216 | | |
206 | 217 | | |
207 | 218 | | |
208 | | - | |
| 219 | + | |
0 commit comments