Skip to content

Instantly share code, notes, and snippets.

@ashishdas09
ashishdas09 / navigateToBrowse.java
Created March 16, 2018 12:12
Android - Navigate with new data using signal fragments
private static final String FRAGMENT_TAG = "browseFragment";
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
navigateToBrowse(0);
}
@ashishdas09
ashishdas09 / CalculateAgeDOB
Created May 3, 2017 13:04
JavaCode - Example to calculate age and DOB
public class Test
{
public static void main(String args[])
{
Year birthYear = new Year(27, 10, 1989);
Year endYear = new Year(3, 5, 2017);
new AgeCalculate()
{
@Override
@ashishdas09
ashishdas09 / Android - Example for handling redirect urls and open PDF without download in webview.txt
Created February 24, 2017 06:44
Android - Example for handling redirect urls and open PDF without download, in webview.
private void init()
{
WebView webview = (WebView) findViewById(R.id.webview);
WebSettings settings = webview.getSettings();
settings.setJavaScriptEnabled(true);
webview.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);
PdfWebViewClient pdfWebViewClient = new PdfWebViewClient(this, webview);
pdfWebViewClient.loadPdfUrl(
"https://www.google.co.in/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0ahUKEwjgwIfp3KXSAhXrhFQKHQqEDHYQFggZMAA&url=http%3A%2F%2Fwww.orimi.com%2Fpdf-test.pdf&usg=AFQjCNERYYcSfMLS5ukBcT2Qy11YxEhXqw&cad=rja");