2013-09-05 2 views
1

이 링크 https://code.google.com/p/android-lockpattern/을 통해 내 응용 프로그램에 패턴 기능을 적용했습니다. 그러나 나는 어떤 이슈에 직면하고있다, 패턴을 확인하기 위해 다음 화면으로 이동하기 위해 계속 버튼을 만들었지 만 전혀 작동하지 않는다. 사용자가 첫 번째 화면에서 패턴을 그리기 시작하면 계속 버튼이 작동하지만 작동하지 않아야합니다. 해결책을 말해주십시오. MainActivity.java 코드를 첨부하고 있습니다. 사전안드로이드에 패턴 잠금 기능 코드를 추가하는 방법 ??

 package com.example.lock_pattern; 
     import com.example.lock_pattern.prefs.DisplayPrefs; 
     public class MainActivity extends Activity { 

     private static final String CLASSNAME = MainActivity.class.getName(); 
     public static final String ACTION_CREATE_PATTERN = CLASSNAME 
     + ".create_pattern"; 


     public static final String ACTION_COMPARE_PATTERN = CLASSNAME 
     + ".compare_pattern"; 


     public static final String ACTION_VERIFY_CAPTCHA = CLASSNAME 
     + ".verify_captcha"; 

* If you use {@link #ACTION_COMPARE_PATTERN} and the user fails to "login" 
     public static final int RESULT_FAILED = RESULT_FIRST_USER + 1; 

* If you use {@link #ACTION_COMPARE_PATTERN} and the user forgot his/ her 
     public static final int RESULT_FORGOT_PATTERN = RESULT_FIRST_USER + 2; 

     * If you use {@link #ACTION_COMPARE_PATTERN}, and the user fails to "login" 
     public static final String EXTRA_RETRY_COUNT = CLASSNAME + ".retry_count"; 

     * Sets value of this key to a theme in {@code R.style.Alp_Theme_*}. Default 
     public static final String EXTRA_THEME = CLASSNAME + ".theme"; 

     * Key to hold the pattern. It must be a {@code char[]} array. 
     public static final String EXTRA_PATTERN = CLASSNAME + ".pattern"; 

* You can provide an {@link ResultReceiver} with this key. The activity 
     public static final String EXTRA_RESULT_RECEIVER = CLASSNAME 
     + ".result_receiver"; 

* Put a {@link PendingIntent} into this key. It will be sent before 
public static final String EXTRA_PENDING_INTENT_OK = CLASSNAME 
     + ".pending_intent_ok"; 

* Put a {@link PendingIntent} into this key. It will be sent before 
public static final String EXTRA_PENDING_INTENT_CANCELLED = CLASSNAME 
     + ".pending_intent_cancelled"; 

* You put a {@link Intent} of <i>{@link Activity}</i> into this extra. The 
public static final String EXTRA_INTENT_ACTIVITY_FORGOT_PATTERN = CLASSNAME 
     + ".intent_activity_forgot_pattern"; 

* Helper enum for button OK commands. (Because we use only one "OK" button 
private static enum ButtonOkCommand { 
    CONTINUE, FORGOT_PATTERN, DONE 
}// ButtonOkCommand 

* Delay time to reload the lock pattern view after a wrong pattern. 
private static final long DELAY_TIME_TO_RELOAD_LOCK_PATTERN_VIEW = DateUtils.SECOND_IN_MILLIS; 

/* 
* FIELDS 
*/ 
private int mMaxRetry; 
private boolean mAutoSave; 
private IEncrypter mEncrypter; 
private int mMinWiredDots; 
private ButtonOkCommand mBtnOkCmd; 
private Intent mIntentResult; 
private int mRetryCount = 0; 

/* 
* CONTROLS 
*/ 
private TextView mTextInfo; 
private LockPatternView mLockPatternView; 
private View mFooter; 
private Button mBtnCancel; 
private Button mBtnConfirm; 

/** 
* Called when the activity is first created. 
*/ 
@Override 
public void onCreate(Bundle savedInstanceState) { 
    if (BuildConfig.DEBUG) 
     Log.d(CLASSNAME, "ClassName = " + CLASSNAME); 

    /* 
    * EXTRA_THEME 
    */ 

    if (getIntent().hasExtra(EXTRA_THEME)) 
     setTheme(getIntent().getIntExtra(EXTRA_THEME, 
       R.style.Alp_Theme_Dark)); 

    super.onCreate(savedInstanceState); 
    Toast.makeText(getApplicationContext(), "oncreate", 7000).show(); 
    mMinWiredDots = DisplayPrefs.getMinWiredDots(this); 
    mMaxRetry = DisplayPrefs.getMaxRetry(this); 
    mAutoSave = SecurityPrefs.isAutoSavePattern(this); 

    /* 
    * Encrypter. 
    */ 
    char[] encrypterClass = SecurityPrefs.getEncrypterClass(this); 
    if (encrypterClass != null) { 
     try { 
      mEncrypter = (IEncrypter) Class.forName(
        new String(encrypterClass), false, getClassLoader()) 
        .newInstance(); 
     } catch (Throwable t) { 
      throw new InvalidEncrypterException(); 
     } 
    } 

    mIntentResult = new Intent(); 
    setResult(RESULT_CANCELED, mIntentResult); 

    initContentView(); 
}// onCreate() 

@Override 
public void onConfigurationChanged(Configuration newConfig) { 
    Log.d(CLASSNAME, "onConfigurationChanged()"); 
    super.onConfigurationChanged(newConfig); 
    initContentView(); 
}// onConfigurationChanged() 

@Override 
public boolean onKeyDown(int keyCode, KeyEvent event) { 
    Toast.makeText(getApplicationContext(), "Inside onKeyDown", Toast.LENGTH_LONG).show(); 
    if (keyCode == KeyEvent.KEYCODE_BACK 
      && ACTION_COMPARE_PATTERN.equals(getIntent().getAction())) { 
     /* 
     * Use this hook instead of onBackPressed(), because onBackPressed() 
     * is not available in API 4. 
     */ 
     finishWithNegativeResult(RESULT_CANCELED); 
     return true; 
    } 

    return super.onKeyDown(keyCode, event); 
}// onKeyDown() 

@Override 
protected void onDestroy() { 
    super.onDestroy(); 
    if (BuildConfig.DEBUG) 
     Log.d(CLASSNAME, "onDestroy()"); 
}// onDestroy() 

/** 
* Initializes UI... 
*/ 
private void initContentView() { 
    /* 
    * Save all controls' state to restore later. 
    */ 

     CharSequence infoText = mTextInfo != null ? mTextInfo.getText() : null; 
    Boolean btnOkEnabled = mBtnConfirm != null ? mBtnConfirm.isEnabled() 
      : null; 
    LockPatternView.DisplayMode lastDisplayMode = mLockPatternView != null ? mLockPatternView 
      .getDisplayMode() : null; 
    List<Cell> lastPattern = mLockPatternView != null ? mLockPatternView 
      .getPattern() : null; 

    setContentView(R.layout.activity_main); 

    UI.adjustDialogSizeForLargeScreen(getWindow()); 

    mTextInfo = (TextView) findViewById(R.id.alp_textview_info); 
    mLockPatternView = (LockPatternView) findViewById(R.id.alp_view_lock_pattern); 

    mFooter = findViewById(R.id.alp_viewgroup_footer); 
    mBtnCancel = (Button) findViewById(R.id.alp_button_cancel); 
    mBtnConfirm = (Button) findViewById(R.id.alp_button_confirm); 

    /* 
    * LOCK PATTERN VIEW 
    */ 

    if (getResources().getBoolean(R.bool.alp_is_large_screen)) { 
     int size = getResources().getDimensionPixelSize(
       R.dimen.alp_lockpatternview_size); 
     LayoutParams lp = mLockPatternView.getLayoutParams(); 
     lp.width = size; 
     lp.height = size; 
     mLockPatternView.setLayoutParams(lp); 
    } 

    /* 
    * Haptic feedback. 
    */ 
    boolean hapticFeedbackEnabled = false; 
    try { 
     hapticFeedbackEnabled = Settings.System.getInt(
       getContentResolver(), 
       Settings.System.HAPTIC_FEEDBACK_ENABLED, 0) != 0; 
    } catch (Throwable t) { 
     /* 
     * Ignore it. 
     */ 
    } 
    mLockPatternView.setTactileFeedbackEnabled(hapticFeedbackEnabled); 

    mLockPatternView.setInStealthMode(DisplayPrefs.isStealthMode(this) 
      && !ACTION_VERIFY_CAPTCHA.equals(getIntent().getAction())); 
    mLockPatternView.setOnPatternListener(mLockPatternViewListener); 
    if (lastPattern != null && lastDisplayMode != null 
      && !ACTION_VERIFY_CAPTCHA.equals(getIntent().getAction())) 
     mLockPatternView.setPattern(lastDisplayMode, lastPattern); 

    /* 
    * COMMAND BUTTONS 
    */ 

    if (ACTION_CREATE_PATTERN.equals(getIntent().getAction())) { 
     Toast.makeText(getApplicationContext(), "initContentView", 7000).show(); 
     mBtnCancel.setOnClickListener(mBtnCancelOnClickListener); 
     mBtnConfirm.setOnClickListener(mBtnConfirmOnClickListener); 

     mBtnCancel.setVisibility(View.VISIBLE); 
     mBtnConfirm.setVisibility(View.VISIBLE); 
     mFooter.setVisibility(View.VISIBLE); 

     if (infoText != null) 
      mTextInfo.setText(infoText); 
     else 
      mTextInfo.setText(R.string.alp_msg_draw_an_unlock_pattern); 

     /* 
     * BUTTON OK 
     */ 
     if (mBtnOkCmd == null) 
      mBtnOkCmd = ButtonOkCommand.CONTINUE; 
     switch (mBtnOkCmd) { 
     case CONTINUE: 
      mBtnConfirm.setText(R.string.alp_cmd_continue); 
      break; 
     case DONE: 
      mBtnConfirm.setText(R.string.alp_cmd_confirm); 
      break; 
     default: 
      /* 
      * Do nothing. 
      */ 
      break; 
     } 
     if (btnOkEnabled != null) 
      mBtnConfirm.setEnabled(btnOkEnabled); 

    }// ACTION_CREATE_PATTERN 
    else if (ACTION_COMPARE_PATTERN.equals(getIntent().getAction())) { 
     if (TextUtils.isEmpty(infoText)) 
      mTextInfo.setText(R.string.alp_msg_draw_pattern_to_unlock); 
     else 
      mTextInfo.setText(infoText); 
     if (getIntent().hasExtra(EXTRA_INTENT_ACTIVITY_FORGOT_PATTERN)) { 
      mBtnConfirm.setOnClickListener(mBtnConfirmOnClickListener); 
      mBtnConfirm.setText(R.string.alp_cmd_forgot_pattern); 
      mBtnConfirm.setEnabled(true); 
      mFooter.setVisibility(View.VISIBLE); 
     } 
    }// ACTION_COMPARE_PATTERN 
    else if (ACTION_VERIFY_CAPTCHA.equals(getIntent().getAction())) { 
     mTextInfo.setText(R.string.alp_msg_redraw_pattern_to_confirm); 

     final ArrayList<Cell> pattern; 
     if (getIntent().hasExtra(EXTRA_PATTERN)) 
      pattern = getIntent() 
        .getParcelableArrayListExtra(EXTRA_PATTERN); 
     else 
      getIntent().putParcelableArrayListExtra(
        EXTRA_PATTERN, 
        pattern = LockPatternUtils 
          .genCaptchaPattern(DisplayPrefs 
            .getCaptchaWiredDots(this))); 

     mLockPatternView.setPattern(DisplayMode.Animate, pattern); 
    }// ACTION_VERIFY_CAPTCHA 
}// initContentView() 

* Encodes {@code pattern} to a string. 
private char[] encodePattern(List<Cell> pattern) { 

* Compares {@code pattern} to the given pattern (
private void doComparePattern(List<Cell> pattern) { 
    Toast.makeText(getApplicationContext(), "Inside doComparePattern", Toast.LENGTH_LONG).show(); 
    if (pattern == null) 
     return; 

    boolean okey = false; 

    if (ACTION_COMPARE_PATTERN.equals(getIntent().getAction())) { 
     char[] currentPattern = getIntent() 
       .getCharArrayExtra(EXTRA_PATTERN); 
     if (currentPattern == null) 
      currentPattern = SecurityPrefs.getPattern(this); 

     okey = Arrays.equals(encodePattern(pattern), currentPattern); 
    }// ACTION_COMPARE_PATTERN 
    else if (ACTION_VERIFY_CAPTCHA.equals(getIntent().getAction())) { 
     final List<Cell> captchaPattern = getIntent() 
       .getParcelableArrayListExtra(EXTRA_PATTERN); 
     okey = captchaPattern.size() == pattern.size(); 
     if (okey) { 
      for (int i = 0; i < captchaPattern.size(); i++) { 
       if (!captchaPattern.get(i).equals(pattern.get(i))) { 
        okey = false; 
        break; 
       } 
      }// for 
     } 
    }// ACTION_VERIFY_CAPTCHA 

    if (okey) 
     finishWithResultOk(null); 
    else { 
     mRetryCount++; 
     mIntentResult.putExtra(EXTRA_RETRY_COUNT, mRetryCount); 

     if (mRetryCount >= mMaxRetry) 
      finishWithNegativeResult(RESULT_FAILED); 
     else { 
      mLockPatternView.setDisplayMode(DisplayMode.Wrong); 
      mTextInfo.setText(R.string.alp_msg_try_again); 
      mLockPatternView.postDelayed(mLockPatternViewReloader, 
        DELAY_TIME_TO_RELOAD_LOCK_PATTERN_VIEW); 
     } 
    } 
}// doComparePattern() 

/** 
* Checks and creates the pattern. 
* 
* @param pattern 
*   the current pattern of lock pattern view. 
*/ 
private void doCheckAndCreatePattern(List<Cell> pattern) { 
    Toast.makeText(getApplicationContext(), "Inside doCheckAndCreatePattern", Toast.LENGTH_LONG).show(); 
    if (pattern.size() < mMinWiredDots) { 
     mLockPatternView.setDisplayMode(DisplayMode.Wrong); 
     mTextInfo.setText(getResources().getQuantityString(
       R.plurals.alp_pmsg_connect_x_dots, mMinWiredDots, 
       mMinWiredDots)); 
     mLockPatternView.postDelayed(mLockPatternViewReloader, 
       DELAY_TIME_TO_RELOAD_LOCK_PATTERN_VIEW); 
     return; 
    } 

    if (getIntent().hasExtra(EXTRA_PATTERN)) { 
     if (Arrays.equals(getIntent().getCharArrayExtra(EXTRA_PATTERN), 
       encodePattern(pattern))) { 
      mTextInfo.setText(R.string.alp_msg_your_new_unlock_pattern); 
      mBtnConfirm.setEnabled(true); 
     } else { 
      mTextInfo.setText(R.string.alp_msg_redraw_pattern_to_confirm); 
      mBtnConfirm.setEnabled(false); 
      mLockPatternView.setDisplayMode(DisplayMode.Wrong); 
      mLockPatternView.postDelayed(mLockPatternViewReloader, 
        DELAY_TIME_TO_RELOAD_LOCK_PATTERN_VIEW); 
     } 
    } else { 
     getIntent().putExtra(EXTRA_PATTERN, encodePattern(pattern)); 
     mTextInfo.setText(R.string.alp_msg_pattern_recorded); 
     mBtnConfirm.setEnabled(true); 
    } 
}// doCheckAndCreatePattern() 

* Finishes activity with {@link Activity#RESULT_OK}. 
private void finishWithResultOk(char[] pattern) { 
    Toast.makeText(getApplicationContext(), "Inside finishWithResultOk", Toast.LENGTH_LONG).show(); 
    if (ACTION_CREATE_PATTERN.equals(getIntent().getAction())) 
     mIntentResult.putExtra(EXTRA_PATTERN, pattern); 
    else { 
     /* 
     * If the user was "logging in", minimum try count can not be zero. 
     */ 
     mIntentResult.putExtra(EXTRA_RETRY_COUNT, mRetryCount + 1); 
    } 

    setResult(RESULT_OK, mIntentResult); 

    /* 
    * ResultReceiver 
    */ 
    ResultReceiver receiver = getIntent().getParcelableExtra(
      EXTRA_RESULT_RECEIVER); 
    if (receiver != null) { 
     Bundle bundle = new Bundle(); 
     if (ACTION_CREATE_PATTERN.equals(getIntent().getAction())) 
      bundle.putCharArray(EXTRA_PATTERN, pattern); 
     else { 
      /* 
      * If the user was "logging in", minimum try count can not be 
      * zero. 
      */ 
      bundle.putInt(EXTRA_RETRY_COUNT, mRetryCount + 1); 
     } 
     receiver.send(RESULT_OK, bundle); 
    } 

    /* 
    * PendingIntent 
    */ 
    PendingIntent pi = getIntent().getParcelableExtra(
      EXTRA_PENDING_INTENT_OK); 
    if (pi != null) { 
     try { 
      pi.send(this, RESULT_OK, mIntentResult); 
     } catch (Throwable t) { 
      if (BuildConfig.DEBUG) { 
       Log.e(CLASSNAME, "Error sending PendingIntent: " + pi); 
       Log.e(CLASSNAME, ">>> " + t); 
       t.printStackTrace(); 
      } 
     } 
    } 

    finish(); 
}// finishWithResultOk() 

/** 
* Finishes the activity with negative result (
* {@link Activity#RESULT_CANCELED}, {@link #RESULT_FAILED} or 
* {@link #RESULT_FORGOT_PATTERN}). 
*/ 
private void finishWithNegativeResult(int resultCode) { 
    if (ACTION_COMPARE_PATTERN.equals(getIntent().getAction())) 
     mIntentResult.putExtra(EXTRA_RETRY_COUNT, mRetryCount); 

    setResult(resultCode, mIntentResult); 

    /* 
    * ResultReceiver 
    */ 
    ResultReceiver receiver = getIntent().getParcelableExtra(
      EXTRA_RESULT_RECEIVER); 
    if (receiver != null) { 
     Bundle resultBundle = null; 
     if (ACTION_COMPARE_PATTERN.equals(getIntent().getAction())) { 
      resultBundle = new Bundle(); 
      resultBundle.putInt(EXTRA_RETRY_COUNT, mRetryCount); 
     } 
     receiver.send(resultCode, resultBundle); 
    } 

    /* 
    * PendingIntent 
    */ 
    PendingIntent pi = getIntent().getParcelableExtra(
      EXTRA_PENDING_INTENT_CANCELLED); 
    if (pi != null) { 
     try { 
      pi.send(this, resultCode, mIntentResult); 
     } catch (Throwable t) { 
      if (BuildConfig.DEBUG) { 
       Log.e(CLASSNAME, "Error sending PendingIntent: " + pi); 
       Log.e(CLASSNAME, ">>> " + t); 
       t.printStackTrace(); 
      } 
     } 
    } 

    finish(); 
}// finishWithNegativeResult() 

/* 
* LISTENERS 
*/ 

private final LockPatternView.OnPatternListener mLockPatternViewListener = new LockPatternView.OnPatternListener() { 

    @Override 
    public void onPatternStart() { 
     Toast.makeText(getApplicationContext(), "Inside onPatternStart", Toast.LENGTH_LONG).show(); 
     mLockPatternView.removeCallbacks(mLockPatternViewReloader); 
     mLockPatternView.setDisplayMode(DisplayMode.Correct); 

     if (ACTION_CREATE_PATTERN.equals(getIntent().getAction())) { 
      Toast.makeText(getApplicationContext(), "Inside action create pattern", Toast.LENGTH_LONG).show(); 
      mTextInfo.setText(R.string.alp_msg_release_finger_when_done); 
      mBtnConfirm.setEnabled(true); 
      if (mBtnOkCmd == ButtonOkCommand.CONTINUE) 
       getIntent().removeExtra(EXTRA_PATTERN); 
     }// ACTION_CREATE_PATTERN 
     else if (ACTION_COMPARE_PATTERN.equals(getIntent().getAction())) { 
      mTextInfo.setText(R.string.alp_msg_draw_pattern_to_unlock); 
     }// ACTION_COMPARE_PATTERN 
     else if (ACTION_VERIFY_CAPTCHA.equals(getIntent().getAction())) { 
      mTextInfo.setText(R.string.alp_msg_redraw_pattern_to_confirm); 
     }// ACTION_VERIFY_CAPTCHA 
    }// onPatternStart() 

    @Override 
    public void onPatternDetected(List<Cell> pattern) { 
     Toast.makeText(getApplicationContext(), "Inside onPatternDetected", Toast.LENGTH_LONG).show(); 
     if (ACTION_CREATE_PATTERN.equals(getIntent().getAction())) { 
      doCheckAndCreatePattern(pattern); 
     }// ACTION_CREATE_PATTERN 
     else if (ACTION_COMPARE_PATTERN.equals(getIntent().getAction())) { 
      doComparePattern(pattern); 
     }// ACTION_COMPARE_PATTERN 
     else if (ACTION_VERIFY_CAPTCHA.equals(getIntent().getAction())) { 
      if (!DisplayMode.Animate.equals(mLockPatternView 
        .getDisplayMode())) 
       doComparePattern(pattern); 
     }// ACTION_VERIFY_CAPTCHA 
    }// onPatternDetected() 

    @Override 
    public void onPatternCleared() { 
     Toast.makeText(getApplicationContext(), "Inside onPatternCleared", Toast.LENGTH_LONG).show(); 
     mLockPatternView.removeCallbacks(mLockPatternViewReloader); 

     if (ACTION_CREATE_PATTERN.equals(getIntent().getAction())) { 
      mLockPatternView.setDisplayMode(DisplayMode.Correct); 
      mBtnConfirm.setEnabled(true); 
      if (mBtnOkCmd == ButtonOkCommand.CONTINUE) { 
       getIntent().removeExtra(EXTRA_PATTERN); 
       mTextInfo.setText(R.string.alp_msg_draw_an_unlock_pattern); 
      } else 
       mTextInfo 
         .setText(R.string.alp_msg_redraw_pattern_to_confirm); 
     }// ACTION_CREATE_PATTERN 
     else if (ACTION_COMPARE_PATTERN.equals(getIntent().getAction())) { 
      mLockPatternView.setDisplayMode(DisplayMode.Correct); 
      mTextInfo.setText(R.string.alp_msg_draw_pattern_to_unlock); 
     }// ACTION_COMPARE_PATTERN 
     else if (ACTION_VERIFY_CAPTCHA.equals(getIntent().getAction())) { 
      mTextInfo.setText(R.string.alp_msg_redraw_pattern_to_confirm); 
      List<Cell> pattern = getIntent().getParcelableArrayListExtra(
        EXTRA_PATTERN); 
      mLockPatternView.setPattern(DisplayMode.Animate, pattern); 
     }// ACTION_VERIFY_CAPTCHA 
    }// onPatternCleared() 

    @Override 
    public void onPatternCellAdded(List<Cell> pattern) { 
     // TODO Auto-generated method stub 
    }// onPatternCellAdded() 
};// mLockPatternViewListener 

private final View.OnClickListener mBtnCancelOnClickListener = new View.OnClickListener() { 

    @Override 
    public void onClick(View v) { 
     finishWithNegativeResult(RESULT_CANCELED); 
    }// onClick() 
};// mBtnCancelOnClickListener 

private final View.OnClickListener mBtnConfirmOnClickListener = new View.OnClickListener() { 

    @Override 
    public void onClick(View v) { 
     if (ACTION_CREATE_PATTERN.equals(getIntent().getAction())) { 
      if (mBtnOkCmd == ButtonOkCommand.CONTINUE) { 
       mBtnOkCmd = ButtonOkCommand.DONE; 
       mLockPatternView.clearPattern(); 
       mTextInfo 
         .setText(R.string.alp_msg_redraw_pattern_to_confirm); 
       mBtnConfirm.setText(R.string.alp_cmd_confirm); 
       mBtnConfirm.setEnabled(false); 
      } else { 
       final char[] pattern = getIntent().getCharArrayExtra(
         EXTRA_PATTERN); 
       if (mAutoSave) 
        SecurityPrefs.setPattern(MainActivity.this, 
          pattern); 
       finishWithResultOk(pattern); 
      } 
     }// ACTION_CREATE_PATTERN 
     else if (ACTION_COMPARE_PATTERN.equals(getIntent().getAction())) { 
      /* 
      * We don't need to verify the extra. First, this button is only 
      * visible if there is this extra in the intent. Second, it is 
      * the responsibility of the caller to make sure the extra is an 
      * Intent of Activity. 
      */ 
      startActivity((Intent) getIntent().getParcelableExtra(
        EXTRA_INTENT_ACTIVITY_FORGOT_PATTERN)); 
      finishWithNegativeResult(RESULT_FORGOT_PATTERN); 
     }// ACTION_COMPARE_PATTERN 
    }// onClick() 
};// mBtnConfirmOnClickListener 

/** 
* This reloads the {@link #mLockPatternView} after a wrong pattern. 
*/ 
private final Runnable mLockPatternViewReloader = new Runnable() { 

    @Override 
    public void run() { 
     mLockPatternView.clearPattern(); 
     mLockPatternViewListener.onPatternCleared(); 
    }// run() 
};// mLockPatternViewReloader 

}

+0

전체 프로젝트가 아닌 관련 부분 만 게시하십시오. – tyczj

답변

0

버그가 initContentView에 초기화에의 감사합니다(). 단추를 mBtnConfirm에로드하기 전에 btnOkEnabled를 설정합니다.

findViewById() 호출을 해당 메소드의 맨 위로 이동하면 모두 설정해야합니다.

+0

해당 기능이 작동하지 않습니다. 힘 닫기 오류가 발생했습니다 – prachi

+0

버튼이 여전히 작동하지 않습니다. 토스트 onclick을 표시하려고했지만 버튼의 응답이 없습니다. 내 코드를보고 오류를 알려주십시오. 미리 감사드립니다. – prachi

관련 문제