2016-04-18 65 views
-1

我有一個android on click函數,當我執行應用程序崩潰一次又一次的函數時,它使用startActivaty() 方法啓動一個intent。這裏是錯誤代碼04-18 23:15:09.012 23801-23801/? I/SELinux: Function: selinux_android_load_priority , priority [3] , priority version is VE=SEPF_SHV-E210S_4.4.4_0028 04-18 23:15:09.012 23801-23801/? E/dalvikvm: >>>>> Normal User 04-18 23:15:09.012 23801-23801/? E/dalvikvm: >>>>> com.example.user.multiplication [ userId:0 | appId:10167 ] 04-18 23:15:09.012 23801-23801/? D/dalvikvm: Late-enabling CheckJNI 04-18 23:15:09.162 23801-23801/com.example.user.multiplication W/dalvikvm: VFY: unable to find class referenced in signature (Landroid/view/SearchEvent;) 04-18 23:15:09.162 23801-23801/com.example.user.multiplication I/dalvikvm: Could not find method android.view.Window$Callback.onSearchRequested, referenced from method android.support.v7.view.WindowCallbackWrapper.onSearchRequested 04-18 23:15:09.162 23801-23801/com.example.user.multiplication W/dalvikvm: VFY: unable to resolve interface method 18817: Landroid/view/Window$Callback;.onSearchRequested (Landroid/view/SearchEvent;)Z 04-18 23:15:09.162 23801-23801/com.example.user.multiplication D/dalvikvm: VFY: replacing opcode 0x72 at 0x0002 04-18 23:15:09.162 23801-23801/com.example.user.multiplication I/dalvikvm: Could not find method android.view.Window$Callback.onWindowStartingActionMode, referenced from method android.support.v7.view.WindowCallbackWrapper.onWindowStartingActionMode 04-18 23:15:09.162 23801-23801/com.example.user.multiplication W/dalvikvm: VFY: unable to resolve interface method 18821: Landroid/view/Window$Callback;.onWindowStartingActionMode (Landroid/view/ActionMode$Callback;I)Landroid/view/ActionMode; 04-18 23:15:09.162 23801-23801/com.example.user.multiplication D/dalvikvm: VFY: replacing opcode 0x72 at 0x0002 04-18 23:15:09.192 23801-23801/com.example.user.multiplication D/MultiPhoneWindow: generateLayout : sMinimumStackBoundForPortraitOrientRect(0, 0 - 0, 0), sMinimumStackBoundForLandscapeOrient=Rect(0, 0 - 0, 0) 04-18 23:15:09.212 23801-23801/com.example.user.multiplication I/dalvikvm: Could not find method android.content.res.TypedArray.getChangingConfigurations, referenced from method android.support.v7.widget.TintTypedArray.getChangingConfigurations 04-18 23:15:09.212 23801-23801/com.example.user.multiplication W/dalvikvm: VFY: unable to resolve virtual method 415: Landroid/content/res/TypedArray;.getChangingConfigurations()I 04-18 23:15:09.212 23801-23801/com.example.user.multiplication D/dalvikvm: VFY: replacing opcode 0x6e at 0x0002 04-18 23:15:09.212 23801-23801/com.example.user.multiplication I/dalvikvm: Could not find method android.content.res.TypedArray.getType, referenced from method android.support.v7.widget.TintTypedArray.getType 04-18 23:15:09.212 23801-23801/com.example.user.multiplication W/dalvikvm: VFY: unable to resolve virtual method 437: Landroid/content/res/TypedArray;.getType (I)I 04-18 23:15:09.212 23801-23801/com.example.user.multiplication D/dalvikvm: VFY: replacing opcode 0x6e at 0x0002 04-18 23:15:09.257 23801-23833/com.example.user.multiplication V/MediaPlayer: decode(53, 390064, 113425) 04-18 23:15:09.257 23801-23831/com.example.user.multiplication V/MediaPlayer: decode(52, 315460, 74558) 04-18 23:15:09.332 23801-23801/com.example.user.multiplication D/libEGL: loaded /system/lib/egl/libEGL_mali.so 04-18 23:15:09.337 23801-23801/com.example.user.multiplication D/libEGL: loaded /system/lib/egl/libGLESv1_CM_mali.so 04-18 23:15:09.342 23801-23801/com.example.user.multiplication D/libEGL: loaded /system/lib/egl/libGLESv2_mali.so 04-18 23:15:09.402 23801-23801/com.example.user.multiplication D/OpenGLRenderer: Enabling debug mode 0 我不明白的代碼。請幫助使用Android on click方法開始意圖後,應用程序崩潰

回答

1

請提供您的主要活動和主要佈局的源代碼,以獲得更好的答案(甚至可能是修復!)。

但爲了我可以在日誌中檢查你正試圖調用一個方法(可能來自佈局文件),你沒有在你的類中提供實現(很可能在你的主要活動中)。根據:

Could not find method android.view.Window$Callback.onSearchRequested, referenced from method android.support.v7.view.WindowCallbackWrapper.onSearchRequested