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
[ | |
{name: 'Afghanistan', code: 'AF'}, | |
{name: 'Åland Islands', code: 'AX'}, | |
{name: 'Albania', code: 'AL'}, | |
{name: 'Algeria', code: 'DZ'}, | |
{name: 'American Samoa', code: 'AS'}, | |
{name: 'AndorrA', code: 'AD'}, | |
{name: 'Angola', code: 'AO'}, | |
{name: 'Anguilla', code: 'AI'}, | |
{name: 'Antarctica', code: 'AQ'}, |
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
Taken from | |
https://www.programcreek.com/java-api-examples/?code=lujianzhao/AndroidBase/AndroidBase-master/AndroidBase/src/main/java/com/ljz/base/common/diskcache/DiskLruCacheHelper.java# | |
import android.content.Context; | |
import android.graphics.Bitmap; | |
import android.graphics.drawable.Drawable; | |
import android.os.Environment; | |
import android.util.Log; | |
import com.jakewharton.disklrucache.DiskLruCache; |
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
/* | |
* Copyright (c) 2017 Emil Davtyan | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining | |
* a copy of this software and associated documentation files (the | |
* "Software"), to deal in the Software without restriction, including | |
* without limitation the rights to use, copy, modify, merge, publish, | |
* distribute, sublicense, and/or sell copies of the Software, and to | |
* permit persons to whom the Software is furnished to do so, subject to | |
* the following conditions: |
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 Object onRetainNonConfigurationInstance() { | |
return this; | |
} | |
Then in YourActivity's onCreate() | |
public void onCreate(Bundle savedState) | |
{ | |
YourActivity prevActivity = (YourActivity)getLastNonConfigurationInstance(); | |
if(prevActivity!= 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
import android.content.Context; | |
import android.graphics.Bitmap; | |
import android.graphics.BitmapFactory; | |
import android.graphics.Canvas; | |
import android.graphics.Matrix; | |
import android.graphics.Paint; | |
import android.media.ExifInterface; | |
import android.os.AsyncTask; | |
import android.os.Environment; |
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
package com.alejandrogr.gists.ofylistref; | |
import com.googlecode.objectify.Ref; | |
import com.googlecode.objectify.annotation.Entity; | |
import com.googlecode.objectify.annotation.Id; | |
import com.googlecode.objectify.annotation.Ignore; | |
import com.googlecode.objectify.annotation.Load; | |
import com.googlecode.objectify.annotation.OnLoad; | |
import java.util.ArrayList; | |
import java.util.List; |
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
compile 'org.jsoup:jsoup:1.10.2' | |
Document doc; | |
try { | |
doc = Jsoup.connect("https://jsoup.org/").followRedirects(true).get(); | |
// doc=Jsoup.parse(new File("/home/gufran/Desktop/JSoupStudy/StumbleUpon - StumbleUpon.html"),null); | |
// get title of the page | |
String title = doc.title(); |
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
For Class | |
/** | |
* <h1>Hello, World!</h1> | |
* The HelloWorld program implements an application that | |
* simply displays "Hello World!" to the standard output. | |
* <p> | |
* Giving proper comments in your program makes it more | |
* user friendly and it is assumed as a high quality code. | |
* |
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 ShowHideToggleButton extends LinearLayout { | |
Context context; | |
public ShowHideToggleButton(final Context context) { | |
this(context, null); | |
} | |
public ShowHideToggleButton(Context context, AttributeSet attrs) { | |
this(context, attrs, 0); |
NewerOlder