android.widget.Button.setOnLongClickListener()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(4.8k)|赞(0)|评价(0)|浏览(143)

本文整理了Java中android.widget.Button.setOnLongClickListener()方法的一些代码示例,展示了Button.setOnLongClickListener()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Button.setOnLongClickListener()方法的具体详情如下:
包路径:android.widget.Button
类名称:Button
方法名:setOnLongClickListener

Button.setOnLongClickListener介绍

暂无

代码示例

代码示例来源:origin: TommyLemon/APIJSON

btnRequestRequest.setOnLongClickListener(new OnLongClickListener() {

代码示例来源:origin: TommyLemon/APIJSON

final int which = i;
buttons[which].setOnClickListener(this);
buttons[which].setOnLongClickListener(new OnLongClickListener() {

代码示例来源:origin: chrisk44/Hijacker

@Override
public void onStart(){
  super.onStart();
  AlertDialog d = (AlertDialog)getDialog();
  if(d != null){
    Button positiveButton = d.getButton(Dialog.BUTTON_POSITIVE);
    positiveButton.setOnLongClickListener(new View.OnLongClickListener(){
      @Override
      public boolean onLongClick(View v){
        v.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS);
        attemptExport(true);
        return false;
      }
    });
    positiveButton.setOnClickListener(new View.OnClickListener(){
      @Override
      public void onClick(View v){
        attemptExport(false);
      }
    });
  }
}
void attemptExport(boolean override){

代码示例来源:origin: GeoODK/collect

@Override
public void setOnLongClickListener(OnLongClickListener l) {
  mCaptureButton.setOnLongClickListener(l);
  mChooseButton.setOnLongClickListener(l);
}

代码示例来源:origin: GeoODK/collect

@Override
public void setOnLongClickListener(OnLongClickListener l) {
  mCaptureButton.setOnLongClickListener(l);
  mChooseButton.setOnLongClickListener(l);
  mPlayButton.setOnLongClickListener(l);
}

代码示例来源:origin: GeoODK/collect

@Override
public void setOnLongClickListener(OnLongClickListener l) {
  mCaptureButton.setOnLongClickListener(l);
  mChooseButton.setOnLongClickListener(l);
  mPlayButton.setOnLongClickListener(l);
}

代码示例来源:origin: GeoODK/collect

@Override
public void setOnLongClickListener(OnLongClickListener l) {
  button.setOnLongClickListener(l);
}

代码示例来源:origin: GeoODK/collect

@Override
public void setOnLongClickListener(OnLongClickListener l) {
  mLaunchIntentButton.setOnLongClickListener(l);
}

代码示例来源:origin: stackoverflow.com

Button someButton = findViewById(R.id.button);

// fire this listener when user click on button
someButton.setOnClickListener(new OnClickListener({...}));

// fire this listener when user do long click on Button
someButton.setOnLongClickListener(new OnLongClickListener({...}));

代码示例来源:origin: GeoODK/collect

@Override
public void setOnLongClickListener(OnLongClickListener l) {
  mCaptureButton.setOnLongClickListener(l);
  mChooseButton.setOnLongClickListener(l);
  mAnnotateButton.setOnLongClickListener(l);
  if (mImageView != null) {
    mImageView.setOnLongClickListener(l);
  }
}

代码示例来源:origin: luili16/UIMocker

@Override
  public void run() {
    bt.setOnClickListener(new View.OnClickListener() {
      @Override
      public void onClick(View v) {
        bt.setText("bt1-Clicked");
      }
    });
    bt.setOnLongClickListener(new View.OnLongClickListener() {
      @Override
      public boolean onLongClick(View v) {
        bt.setText("bt1-longClick");
        return true;
      }
    });
  }
});

代码示例来源:origin: GeoODK/collect

@Override
public void setOnLongClickListener(OnLongClickListener l) {
  mCaptureButton.setOnLongClickListener(l);
  mChooseButton.setOnLongClickListener(l);
  if (mImageView != null) {
    mImageView.setOnLongClickListener(l);
  }
}

代码示例来源:origin: GeoODK/collect

@Override
public void setOnLongClickListener(OnLongClickListener l) {
  mCaptureButton.setOnLongClickListener(l);
  mChooseButton.setOnLongClickListener(l);
  if (mImageView != null) {
    mImageView.setOnLongClickListener(l);
  }
}

代码示例来源:origin: GeoODK/collect

@Override
public void setOnLongClickListener(OnLongClickListener l) {
  mDrawButton.setOnLongClickListener(l);
  if (mImageView != null) {
    mImageView.setOnLongClickListener(l);
  }
}

代码示例来源:origin: GeoODK/collect

@Override
public void setOnLongClickListener(OnLongClickListener l) {
  /*
  mViewButton.setOnLongClickListener(l);
  */
  mGetLocationButton.setOnLongClickListener(l);
  //mStringAnswer.setOnLongClickListener(l);
  mAnswerDisplay.setOnLongClickListener(l);
}

代码示例来源:origin: GeoODK/collect

@Override
public void setOnLongClickListener(OnLongClickListener l) {
  mStringAnswer.setOnLongClickListener(l);
  mGetBarcodeButton.setOnLongClickListener(l);
}

代码示例来源:origin: GeoODK/collect

@Override
public void setOnLongClickListener(OnLongClickListener l) {
  mViewButton.setOnLongClickListener(l);
  mGetLocationButton.setOnLongClickListener(l);
  mStringAnswer.setOnLongClickListener(l);
  mAnswerDisplay.setOnLongClickListener(l);
}

代码示例来源:origin: GeoODK/collect

@Override
public void setOnLongClickListener(OnLongClickListener l) {
  mSignButton.setOnLongClickListener(l);
  if (mImageView != null) {
    mImageView.setOnLongClickListener(l);
  }
}

代码示例来源:origin: GeoODK/collect

@Override
public void setOnLongClickListener(OnLongClickListener l) {
  mAnswer.setOnLongClickListener(l);
  mLaunchIntentButton.setOnLongClickListener(l);
}

代码示例来源:origin: GeoODK/collect

@Override
public void setOnLongClickListener(OnLongClickListener l) {
  mGetBearingButton.setOnLongClickListener(l);
  mStringAnswer.setOnLongClickListener(l);
  mAnswerDisplay.setOnLongClickListener(l);
}

相关文章

Button类方法