當前位置: 首頁>>代碼示例>>Java>>正文


Java Button.performClick方法代碼示例

本文整理匯總了Java中android.widget.Button.performClick方法的典型用法代碼示例。如果您正苦於以下問題:Java Button.performClick方法的具體用法?Java Button.performClick怎麽用?Java Button.performClick使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.widget.Button的用法示例。


在下文中一共展示了Button.performClick方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: testChangePassword_blankCurrentPassword

import android.widget.Button; //導入方法依賴的package包/類
@Test
public void testChangePassword_blankCurrentPassword() {
    EditText mEtCurrPassword = (EditText) activity.findViewById(R.id.editTextChangePassCurrPass);
    EditText mEtNewPassword = (EditText) activity.findViewById(R.id.editTextChangePassNewPass);
    EditText mEtConfirmNewPassword = (EditText) activity.findViewById(R.id.editTextConfirmPassNewPass);
    Button mBtnChange = (Button) activity.findViewById(R.id.change_pass_button);

    mEtCurrPassword.setText("");
    mEtNewPassword.setText("QWERTY");
    mEtConfirmNewPassword.setText("QWERTY");

    TextView label = (TextView) activity.findViewById(R.id.textViewChangePassCurrPassMessage);
    Assert.assertFalse("current password lable is been set before change password",label.getText().length()>1);
    mBtnChange.performClick();
    Assert.assertTrue("current password lable is not been set",label.getText().length()>1);
}
 
開發者ID:Welloculus,項目名稱:MobileAppForPatient,代碼行數:17,代碼來源:ChangePasswordActivityTest.java

示例2: testChangePassword_blankNewPassword

import android.widget.Button; //導入方法依賴的package包/類
@Test
public void testChangePassword_blankNewPassword() {
    EditText mEtCurrPassword = (EditText) activity.findViewById(R.id.editTextChangePassCurrPass);
    EditText mEtNewPassword = (EditText) activity.findViewById(R.id.editTextChangePassNewPass);
    EditText mEtConfirmNewPassword = (EditText) activity.findViewById(R.id.editTextConfirmPassNewPass);
    Button mBtnChange = (Button) activity.findViewById(R.id.change_pass_button);

    mEtCurrPassword.setText("QWERTY");
    mEtNewPassword.setText("");
    mEtConfirmNewPassword.setText("QWERTY");

    TextView label = (TextView) activity.findViewById(R.id.textViewChangePassNewPassMessage);
    Assert.assertFalse("new password lable is been set before change password",label.getText().length()>1);
    mBtnChange.performClick();
    Assert.assertTrue("new password lable is not been set",label.getText().length()>1);
}
 
開發者ID:Welloculus,項目名稱:MobileAppForPatient,代碼行數:17,代碼來源:ChangePasswordActivityTest.java

示例3: testChangePassword_blankConfirmPassword

import android.widget.Button; //導入方法依賴的package包/類
@Test
public void testChangePassword_blankConfirmPassword() {
    EditText mEtCurrPassword = (EditText) activity.findViewById(R.id.editTextChangePassCurrPass);
    EditText mEtNewPassword = (EditText) activity.findViewById(R.id.editTextChangePassNewPass);
    EditText mEtConfirmNewPassword = (EditText) activity.findViewById(R.id.editTextConfirmPassNewPass);
    Button mBtnChange = (Button) activity.findViewById(R.id.change_pass_button);

    mEtCurrPassword.setText("QWERTY");
    mEtNewPassword.setText("QWERTY");
    mEtConfirmNewPassword.setText("");

    TextView label = (TextView) activity.findViewById(R.id.textViewConfirmPassNewPassMessage);
    Assert.assertFalse("confirm password lable is been set before change password",label.getText().length()>1);
    mBtnChange.performClick();
    Assert.assertTrue("confirm password lable is not been set",label.getText().length()>1);
}
 
開發者ID:Welloculus,項目名稱:MobileAppForPatient,代碼行數:17,代碼來源:ChangePasswordActivityTest.java

示例4: testChangePassword_password_does_not_match

import android.widget.Button; //導入方法依賴的package包/類
@Test
public void testChangePassword_password_does_not_match() {
    EditText mEtCurrPassword = (EditText) activity.findViewById(R.id.editTextChangePassCurrPass);
    EditText mEtNewPassword = (EditText) activity.findViewById(R.id.editTextChangePassNewPass);
    EditText mEtConfirmNewPassword = (EditText) activity.findViewById(R.id.editTextConfirmPassNewPass);
    Button mBtnChange = (Button) activity.findViewById(R.id.change_pass_button);

    mEtCurrPassword.setText("QWERTY");
    mEtNewPassword.setText("QWERTY");
    mEtConfirmNewPassword.setText("QWERTY1");

    TextView label = (TextView) activity.findViewById(R.id.textViewConfirmPassNewPassMessage);
    Assert.assertFalse("confirm password lable is been set before change password",label.getText().length()>1);
    mBtnChange.performClick();
    Assert.assertTrue("confirm password lable is not been set",label.getText().length()>1);
}
 
開發者ID:Welloculus,項目名稱:MobileAppForPatient,代碼行數:17,代碼來源:ChangePasswordActivityTest.java

示例5: locateDepartment

import android.widget.Button; //導入方法依賴的package包/類
public void locateDepartment(long departmentId) {
    logger.d("department#locateDepartment id:%s", departmentId);

    if (topContactTitle == null) {
        logger.e("department#TopTabButton is null");
        return;
    }
    Button tabDepartmentBtn = topContactTitle.getTabDepartmentBtn();
    if (tabDepartmentBtn == null) {
        return;
    }
    tabDepartmentBtn.performClick();
    locateDepartmentImpl(departmentId);
}
 
開發者ID:ccfish86,項目名稱:sctalk,代碼行數:15,代碼來源:ContactFragment.java

示例6: performItemSelected

import android.widget.Button; //導入方法依賴的package包/類
private void performItemSelected(Button button) {
    button.performClick();
    setSelectedState(button);
}
 
開發者ID:parkingwang,項目名稱:vehicle-keyboard-android,代碼行數:5,代碼來源:InputView.java


注:本文中的android.widget.Button.performClick方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。