android,kotlin2023. 5. 15. 16:55
android,kotlin2023. 3. 9. 15:23

[kotlin]camera2 Java lang unsatisfiedlinkerror long org opencv core mat n_mat 해결방법

 

onCreate -> 

 

if (!OpenCVLoader.initDebug())
{
    Log.d("OpenCV", "Unable to load OpenCV!")
}
else
{
    Log.d("OpenCV", "OpenCV loaded Successfully!")
}

 

Posted by thdeodls85
android,kotlin2023. 3. 9. 14:47

[kotlin]fragment system backpressed 적용방법

 

activity 에서는 backpressed overriding 있는데

 

fragment에는 없다..

 

androidx에서 제공한단다..

 

fragment에서 작업한다.

override fun onAttach(context: Context) {
    super.onAttach(context)

   val callback : OnBackPressedCallback = object : OnBackPressedCallback(true) {
        override fun handleOnBackPressed() {
           Log.d("T", "handleOnBackPressed ->")
        }
    }
    requireActivity().onBackPressedDispatcher.addCallback(this , callback)
}

주의할 점은 

 

onBackpress를 activity 안에서 구현하고 있다면, super.onBackPressed() 호출 해야.. callback된다.

 

 

[참조] https://readystory.tistory.com/186

 

[Android] Fragment에서 Back Press 처리하기(with. OnBackPressedDispatcher)

Android App을 개발하다 보면 화면을 구성할 때 하나의 액티비티에 다수의 프래그먼트를 사용해서 구성하는 경우가 많습니다. 그러나 안드로이드의 Fragment에는 Activity의 onBackPressed()와 같은 콜백 메

readystory.tistory.com

 

Posted by thdeodls85
android,kotlin2023. 3. 7. 13:34

[kotlin]queuebuffer bufferqueue has been abandoned camera2 해결방법

 

화면 아웃 될려고 할 때, queuebuffer bufferqueue has been abandoned  이슈가 나온다..

 

크래쉬 나는건 아니지만, 카메라가 stop상황으로 바로 가는건 아니다. 

 

그러면 deley를 줘서 camera stop 하고 화면을 아웃해야 한다...

 

unbindAll()

  Timer().schedule(object: TimerTask()
            {
                override fun run() {
					// 화면 아웃 
                }

            }, 100)
Posted by thdeodls85
android,kotlin2023. 2. 20. 15:46

[android]use a compatible library with a minSdk of at most 21, or increase this project's minSdk version to at least 23 해결방법

 

라이브러리의 minsdk버젼을 낮추던지, 내가 쓰고 있는 라이브러리 minSDK올리면 된다.

 

defaultConfig {
    applicationId "com.example.bbbb"
    minSdk 23
    targetSdk 33
    versionCode 1
    versionName "1.0"

    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Posted by thdeodls85
android,kotlin2023. 2. 20. 14:46

[android]all buildscript {} blocks must appear before any plugins {} blocks in the script 해결방법

 

project -> build_gradle 에서 plugins{} buildscript{} 가 앞으로 가야 된다는것이다...

 

buildscript {
    repositories {
        mavenCentral()
    }
}

// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
    id 'com.android.application' version '7.3.1' apply false
    id 'com.android.library' version '7.3.1' apply false
    id 'org.jetbrains.kotlin.android' version '1.7.20' apply false
}

 

Posted by thdeodls85
android,kotlin2023. 1. 13. 14:59

[android studio]This might happen because a process has files open or has its working directory set in the target directory 해결방법

 

clean 할려고 했더니... 

 

프로젝트 안에 있는 'build' 폴더가 삭제 할 수 없다고 나오면서... 작동이 안된단다..

 

build 폴더를 삭제 하고 다시 빌드하면 된다..

Posted by thdeodls85
android,kotlin2023. 1. 5. 14:21