Android JsPromptResult - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android JsPromptResult class.

This code example shows how to use the following methods:confirm
			} 
			else{ 
				webElementCreator.createWebElementAndAddInList(message, view);
			} 
		} 
		r.confirm();
		return true; 
	} 
 
} 
 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:confirm
  public void accept() { 
    AlertManager.removeAlert(this);
    if (isPrompt()) { 
      JsPromptResult promptResult = (JsPromptResult) result;
      String result = textToSend == null ? defaultValue : textToSend;
      promptResult.confirm(result);
    } else { 
      result.confirm();
    } 
  } 
 
  private boolean isPrompt() { 
    return result instanceof JsPromptResult;
  } 
 
  public void dismiss() { 
    AlertManager.removeAlert(this);
    result.cancel();
  } 
 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:confirm
        } 
 
        // Polling for JavaScript messages  
        else if (reqOk && defaultValue != null && defaultValue.equals("gap_poll:")) {
            String r = mPage.getCallbackServer().getJavascript();
            result.confirm(r);
        } 
 
        // Calling into CallbackServer 
        else if (reqOk && defaultValue != null && defaultValue.equals("gap_callbackServer:")) {
            String r = "";
            if (message.equals("usePolling")) {
                r = "" + mPage.getCallbackServer().usePolling();
            } else if (message.equals("restartServer")) {
                mPage.getCallbackServer().restartServer();
            } else if (message.equals("getPort")) {
                r = Integer.toString(mPage.getCallbackServer().getPort());
            } else if (message.equals("getToken")) {
                r = mPage.getCallbackServer().getToken();
            } 

5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:confirm
  public void accept() { 
    AlertManager.removeAlert(this);
    if (isPrompt()) { 
      JsPromptResult promptResult = (JsPromptResult) result;
      String result = textToSend == null ? defaultValue : textToSend;
      promptResult.confirm(result);
    } else { 
      result.confirm();
    } 
  } 
 
  private boolean isPrompt() { 
    return result instanceof JsPromptResult;
  } 
 
  public void dismiss() { 
    AlertManager.removeAlert(this);
    result.cancel();
  } 
 
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:confirm
    @Override 
    public boolean onJsPrompt(WebView view, String url, String message, String defaultValue, JsPromptResult result) {
        TransitFuture<String> future = new TransitFuture<String>();
 
        if (transitAdapter.onJSCall(message, defaultValue, future)) {
            result.confirm(future.block());
            return true; 
        } else { 
            return super.onJsPrompt(view, url, message, defaultValue, result);
        } 
    } 
 
    @Override 
    public boolean onConsoleMessage(ConsoleMessage consoleMessage) {
        switch (consoleMessage.messageLevel()) {
        case ERROR:
            Log.e(TAG, consoleMessage.message());
            break; 
        case WARNING:
            Log.w(TAG, consoleMessage.message());
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:confirm
        } 
 
        @Override 
        public boolean onJsPrompt(WebView view, String url, String message, String defaultValue,
                JsPromptResult result) {
            result.confirm();
            return true; 
        } 
 
        @Override 
        public boolean onJsTimeout() { 
            timeoutCounter++;
            Log.v(LOGTAG, "JavaScript timeout, count=" + timeoutCounter);
            return timeoutCounter > 2;
        } 
 
        public void resetJsTimeout() { 
            timeoutCounter = 0;
        } 
 
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:confirm
 
    @Override 
    public boolean onJsPrompt(WebView view, String url, String message, String defaultValue,
                              JsPromptResult result) {
      // When a web page calls prompt, dismiss the blocking dialog with the default value. 
      result.confirm(defaultValue);
      return true; 
    } 
 
    @Override 
    public boolean onJsConfirm(WebView view, String url, String message, JsResult result) {
      // When a web page calls confirm, dismiss the blocking dialog box. 
      result.confirm();
      return true; 
    } 
 
    @Override 
    public boolean onJsAlert(WebView view, String url, String message, JsResult result) {
      // When a web page calls alert, dismiss the blocking dialog box. 
      result.confirm();
3
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:confirm
            et.setText(defaultValue);
            builder.setView(et);
            builder.setPositiveButton("确定", new OnClickListener() {
                @Override 
                public void onClick(DialogInterface dialog, int which) {
                    result.confirm(et.getText().toString());
                } 
            }).setNeutralButton("取消", new OnClickListener() {
                @Override 
                public void onClick(DialogInterface dialog, int which) {
                    result.cancel();
                } 
            }); 
 
            builder.setOnCancelListener(new OnCancelListener() {
                 
                @Override 
                public void onCancel(DialogInterface dialog) {
                    result.cancel();
                } 
3
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:confirm
        et.setSingleLine();  
        et.setText(defaultValue);  
        builder.setView(et)  
                .setPositiveButton("È·¶¨", new OnClickListener() {  
                    public void onClick(DialogInterface dialog, int which) {  
                        result.confirm(et.getText().toString());  
                    }   
           
                })   
                .setNeutralButton("È¡Ïû", new OnClickListener() {  
                    public void onClick(DialogInterface dialog, int which) {  
                        result.cancel();  
                    }   
                }) 
                ;   
   
        // ÆÁ±ÎkeycodeµÈÓÚ84Ö®ÀàµÄ°´¼ü£¬±ÜÃâ°´¼üºóµ¼Ö¶Ի°¿òÏûÏ¢¶øÒ³ÃæÎÞ·¨ÔÙµ¯³ö¶Ô»°¿òµÄÎÊÌâ  £¬»áÎÞ·¨ÔÙµ÷³ö 
        /*builder.setOnKeyListener(new OnKeyListener() {   
            public boolean onKey(DialogInterface dialog, int keyCode,KeyEvent event) { 
                Log.v("onJsPrompt", "keyCode==" + keyCode + "event="+ event);   
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:confirm
package biz.zentooo; 
 
import android.webkit.WebView; 
import android.webkit.WebChromeClient; 
import android.webkit.JsPromptResult; 
 
public abstract class SBWebChromeClient extends WebChromeClient {
    public abstract boolean onReceiveMessage(String source, String data);
 
    public boolean onJsPrompt(WebView view, String url, String message, String defaultValue, JsPromptResult result) {
        result.confirm("");
        return onReceiveMessage(url, message);
    } 
} 

4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
See Code Examples for Android JsPromptResult Methods: