Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix upload size issue #22

Merged
merged 1 commit into from
Jan 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
)
)
Loading