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
private void restartFirstActivity() { | |
Intent i = getBaseContext().getPackageManager() | |
.getLaunchIntentForPackage(getBaseContext().getPackageName()); | |
i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK); | |
startActivity(i); | |
} | |
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 | |
droid = android.Android() | |
(id, result, error) = droid.scanBarcode() | |
isbn = int(result['SCAN_RESULT']) | |
url = "http://books.google.com?q=%d" % isbn |
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
/** | |
* Gets a reverse address from a location | |
*/ | |
private void getAddress() { | |
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD | |
&& Geocoder.isPresent()) { | |
(new ReverseGeocodingTask(getSherlockActivity())).execute(new Location[] { | |
mLocation | |
}); |
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
<Match> | |
<Class name="com.mycompany.Foo" /> | |
<Method name="bar" /> | |
<Bug pattern="DLS_DEAD_STORE_OF_CLASS_LITERAL" /> | |
</Match> |
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
buildscript { | |
repositories { | |
mavenCentral() | |
} | |
dependencies { | |
classpath 'com.android.tools.build:gradle:0.4' | |
} | |
} | |
apply plugin: 'android' |
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
class Name extends Fragment { | |
// Key to find our state in a bundle | |
private static String ARG_STATE = "arg-state"; | |
private Parcelable state; | |
/** | |
* Empty constructor | |
* | |
* **/ | |
public Name() { |
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
<!DOCTYPE html> | |
<html lang="${lang}"> | |
<head> | |
<title>&{'admin.register.html.politician.page.title.text'}</title> | |
</head> | |
<body> | |
<script src="http://code.jquery.com/jquery.js"></script> | |
<form enctype="multipart/form-data"> | |
<input type="file" id="photo" name="photo"> | |
</form> |
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
buildscript { | |
dependencies { | |
repositories { | |
mavenCentral() | |
mavenLocal() | |
} | |
classpath 'com.android.tools.build:gradle:0.5.+' | |
classpath 'com.squareup.gradle:gradle-android-test-plugin:0.9.+' |
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
/^[\w\sáéíóäëiöúàèììùaaâêîôûа-яА-ЯёЁ]+$ /i French and cyrilic |
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
try { | |
PackageInfo info = getPackageManager().getPackageInfo( | |
getPackageName(), | |
PackageManager.GET_SIGNATURES); | |
for (Signature signature : info.signatures) { | |
MessageDigest md = MessageDigest.getInstance("SHA"); | |
md.update(signature.toByteArray()); | |
Log.d("TAG", "Hash to copy ==> " + Base64.encodeToString(md.digest(), Base64.DEFAULT)); | |
} | |
} catch (PackageManager.NameNotFoundException e) { |
OlderNewer