Android GeolocationPermissions.Callback - 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 GeolocationPermissions.Callback class.

This code example shows how to use the following methods:invoke
              } 
            }); 
          alertDialog.setButton(AlertDialog.BUTTON_NEGATIVE, "Refuse",
            new DialogInterface.OnClickListener() {
              public void onClick(DialogInterface dialog, int which) {
                theCallback.invoke(theOrigin, false, true);
              } 
            }); 
          alertDialog.show();
        } 
      }); 
  } 
 
  /** 
   * Clear Stored Location permissions. When the geolocation API is used in 
   * the WebViewer, the end user is prompted on a per URL basis for whether 
   * or not permission should be granted to access their location. This 
   * function clears this information for all locations. 
   * 
   * As the permissions interface is not available on phones older then 
5
CodeRank
This code example shows how to use the following methods:invoke
  public void onGeolocationPermissionsShowPrompt(String origin,
      Callback callback) {
    if (webClient_ != null) {
      webClient_.onGeolocationPermissionsShowPrompt(origin, callback);
    } else { 
      callback.invoke(origin, false, false);
    } 
  } 
  @Override 
  public void onGeolocationPermissionsHidePrompt() { 
    if (webClient_ != null)
      webClient_.onGeolocationPermissionsHidePrompt();    
  } 
  @Override 
  public boolean onConsoleMessage(ConsoleMessage consoleMessage) {
    if (webClient_ != null) {
      return webClient_.onConsoleMessage(consoleMessage);
    } else { 
      return false; 
    } 
5
CodeRank
This code example shows how to use the following methods:invoke
        public void onGeolocationPermissionsShowPrompt(String origin,
          Callback callback) {
          final Callback theCallback = callback;
          final String theOrigin = origin;
          if (!caller.PromptforPermission()) { // Don't prompt, assume permission
            callback.invoke(origin, true, true);
            return; 
          } 
          AlertDialog alertDialog = new AlertDialog.Builder(activity).create();
          alertDialog.setTitle("Permission Request");
          if (origin.equals("file://"))
            origin = "This Application";
          alertDialog.setMessage(origin + " would like to access your location.");
          alertDialog.setButton(AlertDialog.BUTTON_POSITIVE, "Allow",
            new DialogInterface.OnClickListener() {
              public void onClick(DialogInterface dialog, int which) {
                theCallback.invoke(theOrigin, true, true);
              } 
            }); 
          alertDialog.setButton(AlertDialog.BUTTON_NEGATIVE, "Refuse",
5
CodeRank
This code example shows how to use the following methods:invoke
     * @param callback 
     */ 
    @Override 
    public void onGeolocationPermissionsShowPrompt(String origin, Callback callback) {
        super.onGeolocationPermissionsShowPrompt(origin, callback);
        callback.invoke(origin, true, false);
    } 
 
    /** 
     * Tell the client to display a prompt dialog to the user. 
     * If the client returns true, WebView will assume that the client will 
     * handle the prompt dialog and call the appropriate JsPromptResult method. 
     * 
     * The prompt bridge provided for the InAppBrowser is capable of executing any 
     * oustanding callback belonging to the InAppBrowser plugin. Care has been 
     * taken that other callbacks cannot be triggered, and that no other code 
     * execution is possible. 
     * 
     * To trigger the bridge, the prompt default value should be of the form: 
     * 
4
CodeRank
This code example shows how to use the following methods:invoke
     * @param origin 
     * @param callback 
     */ 
    public void onGeolocationPermissionsShowPrompt(String origin, Callback callback) {
        super.onGeolocationPermissionsShowPrompt(origin, callback);
        callback.invoke(origin, true, false);
    } 
 
    @Override 
    public void onProgressChanged(WebView view, int newProgress) {
        super.onProgressChanged(view, newProgress);
    } 
 
    @Override 
    public void onReceivedTitle(WebView view, String title) {
        mPage.getRunTime().closeProgress();//标题出现,可以隐藏进度条了
        mPage.getTitleBar().setTitles(title);
    } 
 
    @Override 
3
CodeRank
This code example shows how to use the following methods:invoke
        } 
 
        @Override 
        public void onGeolocationPermissionsShowPrompt(String origin, Callback callback) {
            super.onGeolocationPermissionsShowPrompt(origin, callback);
            callback.invoke(origin, true, false);
        } 
 
        @Override 
        public void onProgressChanged(WebView view, int newProgress) {
            super.onProgressChanged(view, newProgress);
            if (progressBar != null) {
                if (progressBar.getVisibility() != View.VISIBLE && newProgress != 100) {
                    progressBar.setVisibility(View.VISIBLE);
                } 
                if (newProgress == 100) {
                    progressBar.setVisibility(View.GONE);
                } else { 
                    progressBar.setProgress(newProgress);
                } 
4
CodeRank
This code example shows how to use the following methods:invoke
			return true; 
		} 
 
		@Override 
		public void onGeolocationPermissionsShowPrompt(String origin, Callback callback) {
			callback.invoke(origin, true, true);
		} 
 
		/*@Override 
		public void onReceivedTitle(WebView view, String title) { 
			setTitle(title); 
			super.onReceivedTitle(view, title); 
		}*/ 
		 
		 
		 
	} 
	 
} 
4
CodeRank
This code example shows how to use the following methods:invoke
         * @param callback 
         */ 
        @Override 
        public void onGeolocationPermissionsShowPrompt(String origin, Callback callback) {
            super.onGeolocationPermissionsShowPrompt(origin, callback);
            callback.invoke(origin, true, false);
        } 
 
        /** 
         * Tell the client to display a prompt dialog to the user. 
         * If the client returns true, WebView will assume that the client will 
         * handle the prompt dialog and call the appropriate JsPromptResult method. 
         * 
         * The prompt bridge provided for the InAppBrowser is capable of executing any 
         * oustanding callback belonging to the InAppBrowser plugin. Care has been 
         * taken that other callbacks cannot be triggered, and that no other code 
         * execution is possible. 
         * 
         * To trigger the bridge, the prompt default value should be of the form: 
         * 
3
CodeRank
This code example shows how to use the following methods:invoke
    } 
 
    @Override 
    public void onGeolocationPermissionsShowPrompt(String origin, Callback callback) {
        super.onGeolocationPermissionsShowPrompt(origin, callback);
        callback.invoke(origin, true, false);
    } 
 
    @Override 
    public void onProgressChanged(WebView view, int newProgress) {
        super.onProgressChanged(view, newProgress);
        if (progressBar != null) {
            if (progressBar.getVisibility() != View.VISIBLE && newProgress != 100) {
                progressBar.setVisibility(View.VISIBLE);
            } 
            if (newProgress == 100) {
                progressBar.setVisibility(View.GONE);
            } else { 
                progressBar.setProgress(newProgress);
            } 
4
CodeRank
This code example shows how to use the following methods:invoke
		 */ 
		@Override 
		public void onGeolocationPermissionsShowPrompt(String origin,
				Callback callback) {
			// always allow permission 
	        callback.invoke(origin, true, false);
	    } 
		/* (non-Javadoc) 
		 * @see android.webkit.WebChromeClient#onConsoleMessage(java.lang.String, int, java.lang.String) 
		 */ 
		@Override 
		public void onConsoleMessage(String message, int lineNumber,
				String sourceID) {
			// TODO Auto-generated method stub 
			super.onConsoleMessage(message, lineNumber, sourceID);
			Log.d(TAG,"ConsoleMessage: "+message+" ("+lineNumber+", "+sourceID+")");
			showAlert("Sorry - there is a problem with the client ("+message+" at "+sourceID+" line "+lineNumber+")");
		} 
		 
	}   
4
CodeRank

Related Android GeolocationPermissions.Callback Questions & Answers:

See Code Examples for Android GeolocationPermissions.Callback Methods: