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


Java Log.w方法代碼示例

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


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

示例1: onReceivedSslError

import org.appcelerator.kroll.common.Log; //導入方法依賴的package包/類
@Override
public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error)
{
	/*
	 * in theory this should be checked to make sure it's not null but if there is some failure 
	 * in the association then usage of webViewProxy should trigger a NPE to make sure the issue 
	 * is not ignored
	 */
	KrollProxy webViewProxy = this.webView.getProxy();
	
	KrollDict data = new KrollDict();
	data.put(TiC.ERROR_PROPERTY_CODE, error.getPrimaryError());
	webView.getProxy().fireSyncEvent(TiC.EVENT_SSL_ERROR, data);

	boolean ignoreSslError = false;
	try {
		ignoreSslError = webViewProxy.getProperties().optBoolean(TiC.PROPERTY_WEBVIEW_IGNORE_SSL_ERROR, false);

	} catch(IllegalArgumentException e) {
		Log.e(TAG, TiC.PROPERTY_WEBVIEW_IGNORE_SSL_ERROR + " property does not contain a boolean value, ignoring"); 
	}

	if (ignoreSslError == true) {
		Log.w(TAG, "ran into SSL error but ignoring...");
		handler.proceed();

	} else {
		Log.e(TAG, "SSL error occurred: " + error.toString());
		handler.cancel();
	}
}
 
開發者ID:chreck,項目名稱:movento-webview,代碼行數:32,代碼來源:TiWebViewClient.java

示例2: getJSValue

import org.appcelerator.kroll.common.Log; //導入方法依賴的package包/類
synchronized public String getJSValue(String expression)
{
	// Don't try to evaluate js code again if the binding has already been destroyed
	if (!destroyed && interfacesAdded) {
		String code = "_TiReturn.setValue((function(){try{return " + expression
			+ "+\"\";}catch(ti_eval_err){return '';}})());";
		Log.d(TAG, "getJSValue:" + code, Log.DEBUG_MODE);
		returnSemaphore.drainPermits();
		synchronized (codeSnippets) {
			codeSnippets.push(code);
		}
		try {
			if (!returnSemaphore.tryAcquire(3500, TimeUnit.MILLISECONDS)) {
				synchronized (codeSnippets) {
					codeSnippets.removeElement(code);
				}
				Log.w(TAG, "Timeout waiting to evaluate JS");
			}
			return returnValue;
		} catch (InterruptedException e) {
			Log.e(TAG, "Interrupted", e);
		}
	}
	return null;
}
 
開發者ID:chreck,項目名稱:movento-webview,代碼行數:26,代碼來源:TiWebViewBinding.java

示例3: evalJS

import org.appcelerator.kroll.common.Log; //導入方法依賴的package包/類
@Kroll.method
public Object evalJS(String code)
{
	// If the view doesn't even exist yet,
	// or if it once did exist but doesn't anymore
	// (like if the proxy was removed from a parent),
	// we absolutely should not try to get a JS value
	// from it.
	TiUIWebView view = (TiUIWebView) peekView();
	if (view == null) {
		Log.w(TAG, "WebView not available, returning null for evalJS result.");
		return null;
	}
	return view.getJSValue(code);
}
 
開發者ID:chreck,項目名稱:movento-webview,代碼行數:16,代碼來源:WebViewProxy.java

示例4: handleRequest

import org.appcelerator.kroll.common.Log; //導入方法依賴的package包/類
private boolean handleRequest(String[] permissions, Integer requestCode, KrollFunction permissionCallback) {
	Activity activity = TiApplication.getAppCurrentActivity();

	if (!(activity instanceof TiBaseActivity)) {
		Log.w(LCAT,	"Requesting permission from non-Titanium activity - not supported");
		return false;
	}

	TiBaseActivity currentActivity = (TiBaseActivity) activity;
	// Do we need a callback and request code in any case?
	if (requestCode == null) {
		Log.d(LCAT, "No request code given - Ti Permissions module will generate one");
		requestCode = currentActivity.getUniqueResultCode();
	}

	// register callback in current activity
	// TODO what is the exact purpose of the context? We should provide the Activity's Proxy, not the module object
	KrollObject context = currentActivity.getActivityProxy().getKrollObject();

	Log.d(LCAT, "Registering callback");
	currentActivity.registerPermissionRequestCallback(requestCode, 
			permissionCallback, context,permissions);

	Log.d(LCAT, "Calling permission request");
	ActivityCompat.requestPermissions(activity,	permissions, requestCode);
	return true;
}
 
開發者ID:stgrosshh,項目名稱:tipermissions,代碼行數:28,代碼來源:TipermissionsModule.java

示例5: setIcon

import org.appcelerator.kroll.common.Log; //導入方法依賴的package包/類
@Kroll.method @Kroll.setProperty
public void setIcon(Object icon)
{
    if (icon instanceof Number) {
        notification.icon = ((Number)icon).intValue();
    } else {
        String iconUrl = TiConvert.toString(icon);
        //TiContext context = invocation == null ? getTiContext() : invocation.getTiContext();
        String iconFullUrl = resolveUrl(null, iconUrl);
        notification.icon = TiUIHelper.getResourceId(iconFullUrl);
        if (notification.icon == 0) {
            Log.w(TAG, "No image found for " + iconUrl);
        }
    }
}
 
開發者ID:GregPerez83,項目名稱:ti-gcm,代碼行數:16,代碼來源:GcmNotificationProxy.java


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