This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<jsp-config> | |
<jsp-property-group> | |
<url-pattern>*.jsp</url-pattern> | |
<trim-directive-whitespaces>true</trim-directive-whitespaces> | |
</jsp-property-group> | |
</jsp-config> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function createCORSRequest(method, url){ | |
var xhr = new XMLHttpRequest(); | |
if ("withCredentials" in xhr){ | |
xhr.open(method, url, true); | |
} else if (typeof XDomainRequest != "undefined"){ | |
xhr = new XDomainRequest(); | |
xhr.open(method, url); | |
} else { | |
xhr = null; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CopyLinkBroadcastReceiver extends BroadcastReceiver { | |
@Override | |
public void onReceive(Context context, Intent intent) { | |
Uri uri = intent.getData(); | |
if (uri != null) { | |
ClipboardManager clipboardManager = | |
(ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE); | |
ClipData clipData = ClipData.newUri(null, uri.toString(), uri); | |
clipboardManager.setPrimaryClip(clipData); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** CustomClickURLSpan **/ | |
package com.example.android.customtabsadvanced; | |
import android.text.style.URLSpan; | |
import android.view.View; | |
public class CustomClickURLSpan extends URLSpan { | |
private OnClickListener mOnClickListener; | |
public CustomClickURLSpan(String url) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static Set<String> getNativeAppPackage(Context context, Uri uri) { | |
PackageManager pm = context.getPackageManager(); | |
//Get all Apps that resolve a generic url | |
Intent browserActivityIntent | |
= new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.example.com")); | |
Set<String> genericResolvedList | |
= extractPackagenames(pm.queryIntentActivities(browserActivityIntent, 0)); | |
//Get all apps that resolve the specific Url |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WebView webView = (WebView)findViewById(R.id.webview); | |
webView.setWebViewClient(new WebViewClient() { | |
@Override | |
public boolean shouldOverrideUrlLoading(WebView view, String url) { | |
return true; | |
} | |
@Override | |
public void onLoadResource(WebView view, String url) { | |
if (url.startsWith("http://www.example.com")) { |
OlderNewer