本文整理匯總了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();
}
}
示例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;
}
示例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);
}
示例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;
}
示例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);
}
}
}