JsResult cancel - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for JsResult cancel method.

This code example shows how to use the following methods:cancel
    return result instanceof JsPromptResult;
  } 
 
  public void dismiss() { 
    AlertManager.removeAlert(this);
    result.cancel();
  } 
 
  public String getText() {
    return message;
  } 
 
  @Override 
  public void authenticateUsing(Credentials credentials) { 
    throw new UnsupportedCommandException("Not implemented yet"); 
  } 
 
  public void sendKeys(String keys) {
    if (!isPrompt()) { 
      throw new ElementNotVisibleException("Alert did not have text field"); 
6
CodeRank
This code example shows how to use the following methods:cancel
    return result instanceof JsPromptResult;
  } 
 
  public void dismiss() { 
    AlertManager.removeAlert(this);
    result.cancel();
  } 
 
  public String getText() {
    return message;
  } 
 
  @Override 
  public void authenticateUsing(Credentials credentials) { 
    throw new UnsupportedCommandException("Not implemented yet"); 
  } 
 
  public void sendKeys(String keys) {
    if (!isPrompt()) { 
      throw new ElementNotVisibleException("Alert did not have text field"); 
5
CodeRank
This code example shows how to use the following methods:cancel
                    result.confirm();
                } 
            }, mPage.getContext().getResources().getString(android.R.string.cancel),
            new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog, int which) {
                    result.cancel();
                } 
            }, new DialogInterface.OnCancelListener() {
                public void onCancel(DialogInterface dialog) {
                    result.cancel();
                } 
            }); 
        dialog.getDialog().setCancelable(true);
        dialog.getDialog().setOnKeyListener(new DialogInterface.OnKeyListener() {
            //DO NOTHING 
            public boolean onKey(DialogInterface dialog, int keyCode, KeyEvent event) {
                if (keyCode == KeyEvent.KEYCODE_BACK) {
                    result.cancel();
                    return false; 
                } else 
3
CodeRank
This code example shows how to use the following methods:cancel
						} 
					}) 
					.setNeutralButton(android.R.string.cancel, new DialogInterface.OnClickListener() {
						@Override 
						public void onClick(DialogInterface dialog, int which) {
							result.cancel();
						} 
					}) 
					.setCancelable(false)
					.create().show();
				return true; 
					 
			} 
 
			@Override 
			public boolean onJsPrompt(WebView view, String url, String message,
					String defaultValue, JsPromptResult result) {
				return super.onJsPrompt(view, url, message, defaultValue, result);
			} 
 
4
CodeRank
This code example shows how to use the following methods:cancel
                    }   
                });   
        builder.setOnCancelListener(new OnCancelListener() {  
            @Override   
            public void onCancel(DialogInterface dialog) {  
                result.cancel();  
            }   
        });   
   
        // ÆÁ±ÎkeycodeµÈÓÚ84Ö®ÀàµÄ°´¼ü£¬±ÜÃâ°´¼üºóµ¼Ö¶Ի°¿òÏûÏ¢¶øÒ³ÃæÎÞ·¨ÔÙµ¯³ö¶Ô»°¿òµÄÎÊÌâ   
        builder.setOnKeyListener(new OnKeyListener() {  
            @Override   
            public boolean onKey(DialogInterface dialog, int keyCode,KeyEvent event) {  
                Log.v("onJsConfirm", "keyCode==" + keyCode + "event="+ event);  
                return true;   
            }   
        });   
        // ½ûÖ¹ÏìÓ¦°´back¼üµÄʼþ   
        // builder.setCancelable(false);   
        AlertDialog dialog = builder.create();  
4
CodeRank
This code example shows how to use the following methods:cancel
        }); 
        dlg.setOnKeyListener(new DialogInterface.OnKeyListener() {
            public boolean onKey(DialogInterface dialog, int keyCode,
                    KeyEvent event) {
                if (keyCode == KeyEvent.KEYCODE_BACK) {
                    result.cancel();
                    return false; 
                } else 
                    return true; 
            } 
        }); 
        dlg.create();
        dlg.show();
        return true; 
    } 
 
    /** 
     * 执行在UI线程 
     */ 
    @Override 
4
CodeRank
This code example shows how to use the following methods:cancel
                    } 
                }); 
                builder.setNegativeButton("No", new DialogInterface.OnClickListener() {
                    @Override 
                    public void onClick(DialogInterface arg0, int arg1) {
                        result.cancel();
                    } 
                }); 
                builder.setCancelable(false);
                builder.setMessage(message).create().show();
                return true; 
            } 
        }); 
        web.loadUrl("file:///android_asset/test.html");
    } 
} 
4
CodeRank
This code example shows how to use the following methods:cancel
				result.cancel();
			} 
		}).setOnCancelListener(new DialogInterface.OnCancelListener() {
			@Override 
			public void onCancel(DialogInterface dialog) {
				result.cancel();
			} 
		}).show();
 
		return true; 
	} 
} 
4
CodeRank
This code example shows how to use the following methods:cancel
			JsResult result) {
		if (message.length() != 0) {
			AlertDialog.Builder builder = new AlertDialog.Builder(
					base);
			builder.setTitle("Ìáʾ").setMessage(message).show();
			result.cancel();
			return true; 
		} 
		return false; 
	} 
	 
	 
} 
4
CodeRank
This code example shows how to use the following methods:cancel
					} 
				}); 
				dlg.setNegativeButton(android.R.string.cancel, 
					new DialogInterface.OnClickListener() {
						public void onClick(DialogInterface dialog, int which) {
						res.cancel();
					} 
				}); 
				dlg.create();
				dlg.show();
			} 
        	return true; 
        } 
         
    } 
 
    /** 
     * WebChromeClient that extends GapClient with additional support for Android 2.X 
     */ 
    public class EclairClient extends GapClient { 
2
CodeRank

Related JsResult cancel Questions & Answers:

cancel Method Overview
Handle the result if the user cancelled the dialog.
See Code Examples for other Android JsResult Methods: