java - Calling Methods of Pattern Library into Activity -
i using android pattern lock library from: https://code.google.com/p/android-lockpattern/source/browse/
after import library not able call single function of library, whenever run app,getting force close inflate exception.please solve problem. sorry bad english
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 error:
11-13 12:40:53.690: e/androidruntime(1389): java.lang.runtimeexception: unable start activity componentinfo{com.example.otpdemo/group.pals.android.lib.ui.lockpattern.lockpatternactivity}: android.view.inflateexception: binary xml file line #18: error inflating class group.pals.android.lib.ui.lockpattern.widget.lockpatternview_v14
11-13 12:40:53.690: e/androidruntime(1389): @ group.pals.android.lib.ui.lockpattern.lockpatternactivity.initcontentview(lockpatternactivity.java:7)
are eclipse user? how importing library? should download library project, unpack , import (folder code inside zip), right click on -> properties -> android section , there check "is library". in app same, left "is library" unchecked , press "add" button , add lib
Comments
Post a Comment