소개
게시글
질문&답변
2024.04.25
Navigation Data Transfer Safe Args 강의중에서
Too many arguments for public final fun actionBlankFragment1ToBlankFragment2(): NavDirections defined in com.dongguninnovatiion.navidatatransfer.BlankFragment1Directions.Companion 이런메세지가 뜨는군요 ..
- 0
- 2
- 148
질문&답변
2024.03.26
Retrofit + ViewModelScope + RecyclerView + Glide 강의중에서
아래처럼 수정하니 Glide 부분에 에러가 사라지는군요왜 그럴까요 ???build.gradle.ktsimplementation("com.github.bumptech.glide:glide:4.14.2") annotationProcessor("com.github.bumptech.glide:compiler:4.14.2") AndroidManifest.xml
- 0
- 2
- 164
질문&답변
2024.03.25
Retrofit 간단한 예제 변경 강의중에서
아차 제실수이군요AndroidManifest.xml 부분을 입력하지 않았습니다죄송합니다
- 0
- 2
- 184
질문&답변
2024.03.20
LiveData 와 MutableLiveData 차이강의중에서
해당코드를 viewModel = ViewModelProvider(this)[MainViewModel::class.java] 로 변경하니 오류가 사라지네요 캄사합니다
- 0
- 5
- 306
질문&답변
2024.03.17
Room db kotlin 관련질문
project build.gradle.ktsplugins { id("com.android.application") version "8.2.2" apply false id("org.jetbrains.kotlin.android") version "1.9.22" apply false kotlin("kapt") version "1.9.21"} Module 수준의 build.gradle.ktsplugins { id("com.android.application")id("org.jetbrains.kotlin.android")id("org.jetbrains.kotlin.kapt")}android { namespace = "com.dongguninnovatiion.db_room2" compileSdk = 34 defaultConfig { applicationId = "com.dongguninnovatiion.db_room2" minSdk = 24 targetSdk = 34 versionCode = 1 versionName = "1.0" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" } buildTypes { release { isMinifyEnabled = false proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro" )} getByName("debug") { sourceSets { getByName("main") { java.srcDir(File("build/generated/ksp/debug/kotlin"))} } } } compileOptions { sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 } kotlinOptions { jvmTarget = "1.8" } buildFeatures { dataBinding = true viewBinding = true }}dependencies { implementation("androidx.core:core-ktx:1.12.0")implementation("androidx.appcompat:appcompat:1.6.1")implementation("com.google.android.material:material:1.11.0")implementation("androidx.constraintlayout:constraintlayout:2.1.4")testImplementation("junit:junit:4.13.2")androidTestImplementation("androidx.test.ext:junit:1.1.5")androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")val roomVersion = "2.6.1" implementation ("androidx.room:room-runtime:$roomVersion")annotationProcessor ("androidx.room:room-compiler:$roomVersion")// optional - RxJava2 support for Room implementation ("androidx.room:room-rxjava2:$roomVersion")// optional - RxJava3 support for Room implementation ("androidx.room:room-rxjava3:$roomVersion")// optional - Guava support for Room, including Optional and ListenableFuture implementation ("androidx.room:room-guava:$roomVersion")// optional - Test helpers testImplementation ("androidx.room:room-testing:$roomVersion")// optional - Paging 3 Integration implementation ("androidx.room:room-paging:2.4.0-rc01")}MainActivity.ktclass MainActivity : AppCompatActivity() {private lateinit var binding: ActivityMainBindingprivate lateinit var db: TodoDatabaseoverride fun onCreate(savedInstanceState: Bundle?) {super.onCreate(savedInstanceState)binding = ActivityMainBinding.inflate(layoutInflater)setContentView(binding.root)val db = Room.databaseBuilder(applicationContext, TodoDatabase::class.java,"Todo" ).allowMainThreadQueries().build()binding.addBtn.setOnClickListener{ addTodo()refreshTodo()} }private fun addTodo() {val t1 = binding.todoEdit.text.toString()CoroutineScope(Dispatchers.IO).launch { db.todoDao().insert(Todo(t1))} }private fun refreshTodo() {CoroutineScope(Dispatchers.Main).launch { val data = CoroutineScope(Dispatchers.IO).async { db.todoDao().getAll().toString()}.await()if(data != null) {// binding.resultText.setText("${data.toString()}") }} }} 이렇게 수정하여도 앱이 죽는군요
- 0
- 2
- 171