File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
sentry-samples/sentry-samples-android/src/main/java/io/sentry/samples/android Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -96,6 +96,7 @@ class MainActivity : AppCompatActivity() {
9696 private var screenLoadCount = 0
9797 internal lateinit var imageFile: File
9898
99+ @SuppressLint(" NewApi" )
99100 override fun onCreate (savedInstanceState : Bundle ? ) {
100101 super .onCreate(savedInstanceState)
101102 SharedState .isOrientationChange = intent.getBooleanExtra(" isOrientationChange" , false )
@@ -149,8 +150,10 @@ class MainActivity : AppCompatActivity() {
149150 applicationContext.resources.openRawResource(R .raw.sentry).use { inputStream ->
150151 FileOutputStream (file).use { outputStream ->
151152 val bytes = ByteArray (1024 )
152- while (inputStream.read(bytes) != - 1 ) {
153- outputStream.write(bytes)
153+ var length = inputStream.read(bytes)
154+ while (length != - 1 ) {
155+ outputStream.write(bytes, 0 , length)
156+ length = inputStream.read(bytes)
154157 }
155158 outputStream.flush()
156159 }
You can’t perform that action at this time.
0 commit comments