我正在使用Android模式锁库: https://code.google.com/p/android-lockpattern/source/browse/
导入库后,我无法调用库的单个函数,每当我运行我的应用程序时,强制关闭膨胀异常。请任何人解决我的问题。 抱歉我的英文不好
package com.example.otpdemo;
import group.pals.android.lib.ui.lockpattern.LockPatternActivity;
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.widget.Button;
public class MainActivity extends Activity {
char[] savedPattern;
private static final int REQ_CREATE_PATTERN = 1;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Intent intent = new Intent(LockPatternActivity.ACTION_CREATE_PATTERN, null,
MainActivity.this,LockPatternActivity.class);
startActivityForResult(intent, REQ_CREATE_PATTERN);
}
@Override
protected void onActivityResult(int requestCode, int resultCode,Intent data) {
switch (requestCode) {
case REQ_CREATE_PATTERN: {
if (resultCode == RESULT_OK) {
char[] pattern = data.getCharArrayExtra(LockPatternActivity.EXTRA_PATTERN);
}
break;
}
}
}
LOgcat错误:
11-13 12:40:53.690:E / AndroidRuntime(1389):java.lang.RuntimeException:无法启动活动ComponentInfo {com.example.otpdemo / group.pals.android.lib.ui.lockpattern.LockPatternActivity }:android.view.InflateException:二进制XML文件行#18:错误导致类group.pals.android.lib.ui.lockpattern.widget.LockPatternView_v14
11-13 12:40:53.690:E / AndroidRuntime(1389):at group.pals.android.lib.ui.lockpattern.LockPatternActivity.initContentView(LockPatternActivity.java:7)
答案 0 :(得分:0)