Skip to content

Commit

Permalink
Fix upload size issue
Browse files Browse the repository at this point in the history
  • Loading branch information
simosathan9 committed Jan 11, 2025
1 parent eee52d8 commit 1b3a5a9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
14 changes: 13 additions & 1 deletion app/src/main/java/com/example/estiaseek/MainActivity.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.example.estiaseek

import android.annotation.SuppressLint
import android.database.CursorWindow
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
Expand All @@ -11,14 +13,24 @@ import androidx.lifecycle.ViewModelProvider
import com.example.estiaseek.data.EstiaSeekDatabase
import com.example.estiaseek.data.OfflineUsersRepository
import com.example.estiaseek.ui.navigation.NavigationHelper
import com.example.estiaseek.ui.theme.EstiaSeekTheme
import com.example.estiaseek.ui.viewmodels.CandidateSearchViewModel
import com.example.estiaseek.ui.viewmodels.CandidateSearchViewModelFactory
import com.example.estiaseek.ui.viewmodels.CreateApplicantViewModel
import com.example.estiaseek.ui.theme.EstiaSeekTheme
import java.lang.reflect.Field


class MainActivity : ComponentActivity() {
@SuppressLint("DiscouragedPrivateApi")
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
try {
val field: Field = CursorWindow::class.java.getDeclaredField("sCursorWindowSize")
field.isAccessible = true
field.set(null, 100 * 1024 * 1024) //the 100MB is the new size
} catch (e: Exception) {
e.printStackTrace()
}

// Initialize the database and repository
val database = EstiaSeekDatabase.getDatabase(applicationContext)
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/example/estiaseek/data/User.kt
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ data class User(
val jobTitle: String,
@ColumnInfo(name = "PhotoData")
val photoData: ByteArray? = null
)
)

0 comments on commit 1b3a5a9

Please sign in to comment.