This file contains hidden or 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
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.google.com")); | |
startActivity(browserIntent); |
This file contains hidden or 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
Intent intent = new Intent(Intent.ACTION_SEND); | |
intent.setType("text/html"); | |
intent.putExtra(Intent.EXTRA_EMAIL, new String[]{"[email protected]"}); | |
intent.putExtra(Intent.EXTRA_SUBJECT, "the subject"); | |
intent.putExtra(Intent.EXTRA_TEXT, Html.fromHtml("the content")); | |
intent.putExtra(Intent.EXTRA_STREAM, Uri.parse("file:///sdcard/file.ext")); | |
startActivity(intent); |
This file contains hidden or 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
Intent emailIntent = new Intent(Intent.ACTION_SENDTO, Uri.fromParts("mailto", "[email protected]", null)); | |
emailIntent.putExtra(Intent.EXTRA_SUBJECT, "EXTRA_SUBJECT"); | |
startActivity(Intent.createChooser(emailIntent, "Send email...")); |
This file contains hidden or 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 MyActivity extends Activity { | |
private OrientationEventListener orientationEventListener; | |
private boolean isPortrait; | |
@Override | |
public void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
orientationEventListener = new OrientationEventListener(this) { | |
@Override | |
public void onOrientationChanged(int orientation) { |
This file contains hidden or 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
lame -h -b 192 from.wav to.mp3 | |
oggenc -b 192 from.wav -o to.ogg |
This file contains hidden or 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
#!/bin/sh | |
show_help() { | |
cat << EOF | |
Usage: ${0##*/} -i INPUT_FILE -o OUTPUT_RES_DIR -s MDPI_SIZE -n NAME | |
EOF | |
} | |
while getopts "hi:s:o:n:" opt; do | |
case $opt in | |
i) |
This file contains hidden or 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 DrawerListView(context: Context, attrs: AttributeSet) : ListView(context, attrs) { | |
val widthCalculated : Int | |
init { | |
val displayMetrics = getContext().getResources().getDisplayMetrics() | |
val maxWidth = Math.round(400 * displayMetrics.xdpi / DisplayMetrics.DENSITY_DEFAULT) | |
val wm = getContext().getSystemService(Context.WINDOW_SERVICE) as WindowManager | |
val size = Point() | |
wm.getDefaultDisplay().getSize(size) |
This file contains hidden or 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
all { flavor -> | |
task("${flavor.name}GoogleServices", type: Copy) { | |
description = 'Switches to google-services.json depending on flavor' | |
from "src/${flavor.name}" | |
include "google-services.json" | |
into "." | |
} | |
} |
This file contains hidden or 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
afterEvaluate { | |
android.productFlavors.all { | |
flavor -> | |
tasks."generate${flavor.name.capitalize()}DebugResources".dependsOn "${flavor.name}GoogleServices" | |
tasks."generate${flavor.name.capitalize()}ReleaseResources".dependsOn "${flavor.name}GoogleServices" | |
} | |
} |
OlderNewer