소개
게시글
질문&답변
Navigation Data Transfer Safe Args 강의중에서
Too many arguments for public final fun actionBlankFragment1ToBlankFragment2(): NavDirections defined in com.dongguninnovatiion.navidatatransfer.BlankFragment1Directions.Companion 이런메세지가 뜨는군요 ..
- 0
- 2
- 154
질문&답변
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
- 172
질문&답변
Retrofit 간단한 예제 변경 강의중에서
아차 제실수이군요AndroidManifest.xml 부분을 입력하지 않았습니다죄송합니다
- 0
- 2
- 187
질문&답변
LiveData 와 MutableLiveData 차이강의중에서
해당코드를 viewModel = ViewModelProvider(this)[MainViewModel::class.java] 로 변경하니 오류가 사라지네요 캄사합니다
- 0
- 5
- 309
질문&답변
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
- 174
질문&답변
Room db kotlin 강의중에서
일부오류는 사라졌으나 아래부분에서 오류가 발생합니다addButton.setOnClickListener(db.todoDao().insert(Todo(todoEdit.text.toString()))resultText.text = db.todoDao().getAll().toString()) (사진)
- 0
- 3
- 277
질문&답변
LiveData 와 MutableLiveData 차이강의중에서
github 주소 올려두었습니다
- 0
- 5
- 309
질문&답변
Room db kotlin 강의중에서
http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity"> android:id="@+id/todo_edit" android:hint="활동메모" android:layout_margin="20dp" android:layout_width="match_parent" android:layout_height="60dp" android:background="@android:color/transparent" tools:ignore="MissingConstraints" /> android:id="@+id/result_text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Hello World!" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> android:id="@+id/add_button" android:text="추가" android:textColor="@color/white" android:background="@color/black" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="20dp" android:layout_marginStart="160dp" android:layout_marginTop="256dp" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" />
- 0
- 3
- 277
질문&답변
LiveData 와 MutableLiveData 차이강의중에서
github 주소입니당https://github.com/dongguntechnology/ViewModelMutableLiveData
- 0
- 5
- 309
질문&답변
LiveData 와 MutableLiveData 차이강의중에서
class MainActivity : AppCompatActivity() {override fun onCreate(savedInstanceState: Bundle?) {super.onCreate(savedInstanceState)setContentView(R.layout.activity_main)viewModel = ViewModelProvider(this).get(MainViewModel::class.java)findViewByIdutton>(R.id.btnArea).setOnClickListener { viewModel.plusLiveDataValue()} viewModel.testLiveData.observe(this, Observer { findViewByIdxtView>(R.id.textArea).text = it.toString()})}}
- 0
- 5
- 309