奇怪的是,我的小“键盘”应用程序抛出了这样的错误:
12-09 21:38:20.736: ERROR/AndroidRuntime(20076): java.lang.RuntimeException: Unable to instantiate service AKeyboard.com.rob.AKeyboard:
java.lang.ClassNotFoundException: AKeyboard.com.rob.AKeyboard in loader dalvik.system.PathClassLoader[/data/app/AKeyboard.com.rob-2.apk]
package AКeyboard.com.rob;
import android.inputmethodservice.InputMethodService;
import android.inputmethodservice.KeyboardView;
import android.view.View;
import android.widget.LinearLayout;
public class main extends InputMethodService
implements KeyboardView.OnKeyboardActionListener {
private LinearLayout mInputView;
@Override public void onCreate() {
super.onCreate();
}
@Override public View onCreateInputView() {
mInputView = (LinearLayout) getLayoutInflater().inflate(R.layout.main, null);
return mInputView;
}
. . .
有什么想法吗?
谢谢!
答案 0 :(得分:2)
您的AndroidManifest.xml
显然希望找到一个名为AKeyboard.com.rob.AKeyboard
的课程,但您已将课程定义为main
(完全限定为AKeyboard.com.rob.main
)。重命名课程或更改您的清单。