czlucius / code-scanner

An Android app to scan and generate codes(barcodes/QR codes)
GNU Affero General Public License v3.0
39 stars 24 forks source link

App crash when click share button in CreateFragment.java line 224 #64

Open shendew opened 10 months ago

shendew commented 10 months ago

Used mediastore to get the file path. Add Extra subject and createrchooser msg to give a idea to user.

shendew commented 10 months ago

Added

czlucius commented 10 months ago

@shendew are you sure this is not because of mismatching package names? The debug version has a package name of com.czlucius.scan.debug, but the content provider has a name of com.czlucius.scan.provider without the .debug. I think this just happens on debug builds

shendew commented 10 months ago

@shendew are you sure this is not because of mismatching package names? The debug version has a package name of com.czlucius.scan.debug, but the content provider has a name of com.czlucius.scan.provider without the .debug. I think this just happens on debug builds

Yes It could be, But my code part will work both situations without crash.

czlucius commented 10 months ago

@shendew maybe you want to rewrite your PR, such that it uses the content provider instead, but with the app's package name prefixed instead of hardcoded? Both in that file and in the manifest.

I see your patch uses the MediaStore API if an exception is raised. Can you use IllegalArgumentException instead? And can you move strings to strings.xml? Also what's the "mmmm" about?

Additionally, can you remove the extra subject and title? I think it's better to have a consistent experience, and also if it's added it would have to be translated across the many languages my app supports. Alternatively you may want to also translate them and retrieve them from strings resources.

Thanks!