마스터Q&A 안드로이드는 안드로이드 개발자들의 질문과 답변을 위한 지식 커뮤니티 사이트입니다. 안드로이드펍에서 운영하고 있습니다. [사용법, 운영진]

디비의 특정열을 사용해서 같은 행의 다른 열도 출력하고 싶습니다.

0 추천

Helper = new myDBHelper(this);
sqlDB = Helper.getReadableDatabase();

Cursor cursor;
cursor = sqlDB.rawQuery("SELECT * FROM readTBL;", null);

String[] result = new String[8];

for(int i=0; i<8; i++){
    cursor.moveToNext();
    result[i] = cursor.getString(0);
}

int j = 0;
for(int k=0; k<8; k++){
    for(int i=0; i<4; i++){
        if(result[k] == votedBook[i]){
            cursor.moveToPosition(k);
            et[j].setText(cursor.getString(0));
            j++;
        }
    }

}

votedBook 배열의 데이터를 이용해서 같은 행의  다른 열을 출력하고 싶습니다ㅠㅠㅠ

votedBook에는 title 열의 자료가 들어 있는 상태입니다! 그래서 같은 cursor행의 author열을 출력하고 싶습니다ㅠㅠ 

아래같은 에러가 뜹니다ㅠㅠ

제발 도와주세요ㅠㅠ

2021-05-11 17:05:33.031 7074-7074/? I/com.example.pj: Not late-enabling -Xcheck:jni (already on)
2021-05-11 17:05:33.051 7074-7074/? I/com.example.pj: Unquickening 12 vdex files!
2021-05-11 17:05:33.052 7074-7074/? W/com.example.pj: Unexpected CPU variant for X86 using defaults: x86
2021-05-11 17:05:33.378 7074-7074/com.example.pj D/NetworkSecurityConfig: No Network Security Config specified, using platform default
2021-05-11 17:05:33.379 7074-7074/com.example.pj D/NetworkSecurityConfig: No Network Security Config specified, using platform default
2021-05-11 17:05:33.427 7074-7115/com.example.pj D/libEGL: loaded /vendor/lib/egl/libEGL_emulation.so
2021-05-11 17:05:33.441 7074-7115/com.example.pj D/libEGL: loaded /vendor/lib/egl/libGLESv1_CM_emulation.so
2021-05-11 17:05:33.451 7074-7115/com.example.pj D/libEGL: loaded /vendor/lib/egl/libGLESv2_emulation.so
2021-05-11 17:05:33.601 7074-7074/com.example.pj W/com.example.pj: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (greylist, reflection, allowed)
2021-05-11 17:05:33.602 7074-7074/com.example.pj W/com.example.pj: Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (greylist, reflection, allowed)
2021-05-11 17:05:33.701 7074-7074/com.example.pj W/FileUtils: Failed to chmod(/data/user/0/com.example.pj/databases/readDB.db): android.system.ErrnoException: chmod failed: EPERM (Operation not permitted)
2021-05-11 17:05:33.821 7074-7113/com.example.pj D/HostConnection: HostConnection::get() New Host Connection established 0xeb3e0760, tid 7113
2021-05-11 17:05:33.827 7074-7113/com.example.pj D/HostConnection: HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_vulkan ANDROID_EMU_deferred_vulkan_commands ANDROID_EMU_vulkan_null_optional_strings ANDROID_EMU_vulkan_create_resources_with_requirements ANDROID_EMU_YUV_Cache ANDROID_EMU_async_unmap_buffer ANDROID_EMU_vulkan_ignored_handles ANDROID_EMU_vulkan_free_memory_sync ANDROID_EMU_vulkan_shader_float16_int8 ANDROID_EMU_vulkan_async_queue_submit GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_async_frame_commands ANDROID_EMU_gles_max_version_2 
2021-05-11 17:05:33.828 7074-7113/com.example.pj W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
2021-05-11 17:05:33.833 7074-7113/com.example.pj D/EGL_emulation: eglCreateContext: 0xeb3ded20: maj 2 min 0 rcv 2
2021-05-11 17:05:33.857 7074-7113/com.example.pj D/EGL_emulation: eglMakeCurrent: 0xeb3ded20: ver 2 0 (tinfo 0xeb6f8e30) (first time)
2021-05-11 17:05:33.869 7074-7113/com.example.pj I/Gralloc4: mapper 4.x is not supported
2021-05-11 17:05:33.869 7074-7113/com.example.pj D/HostConnection: createUnique: call
2021-05-11 17:05:33.870 7074-7113/com.example.pj D/HostConnection: HostConnection::get() New Host Connection established 0xeb3df0a0, tid 7113
2021-05-11 17:05:33.870 7074-7113/com.example.pj D/goldfish-address-space: allocate: Ask for block of size 0x100
2021-05-11 17:05:33.889 7074-7113/com.example.pj D/goldfish-address-space: allocate: ioctl allocate returned offset 0x3fd1ed000 size 0x2000
2021-05-11 17:05:33.893 7074-7113/com.example.pj D/HostConnection: HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_vulkan ANDROID_EMU_deferred_vulkan_commands ANDROID_EMU_vulkan_null_optional_strings ANDROID_EMU_vulkan_create_resources_with_requirements ANDROID_EMU_YUV_Cache ANDROID_EMU_async_unmap_buffer ANDROID_EMU_vulkan_ignored_handles ANDROID_EMU_vulkan_free_memory_sync ANDROID_EMU_vulkan_shader_float16_int8 ANDROID_EMU_vulkan_async_queue_submit GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_async_frame_commands ANDROID_EMU_gles_max_version_2 
2021-05-11 17:05:41.954 7074-7074/com.example.pj W/FileUtils: Failed to chmod(/data/user/0/com.example.pj/databases/readDB.db): android.system.ErrnoException: chmod failed: EPERM (Operation not permitted)

레고레고 (140 포인트) 님이 2021년 5월 11일 질문
혹시 DB가 외장카드나 다른 곳에 존재하는 건가요?
헉 답글 달아주셔서 감사합니다!
다른 방식으로 플게 됐습니다!! 감사해용

답변 달기

· 글에 소스 코드 보기 좋게 넣는 법
· 질문에 대해 추가적인 질문이나 의견이 있으면 답변이 아니라 댓글로 달아주시기 바랍니다.
표시할 이름 (옵션):
개인정보: 당신의 이메일은 이 알림을 보내는데만 사용됩니다.
스팸 차단 검사:
스팸 검사를 다시 받지 않으려면 로그인하거나 혹은 가입 하세요.
...