Skip to content

Instantly share code, notes, and snippets.

<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="25dp"
android:height="25dp"
android:viewportWidth="490.4"
android:viewportHeight="490.4">
<path
android:fillColor="#000000"
android:pathData="M245.2,490.4c135.2,0,245.2-110,245.2-245.2S380.4,0,245.2,0S0,110,0,245.2C0,380.4,110,490.4,245.2,490.4z
@bansalayush
bansalayush / GetImageSize.java
Created March 7, 2017 06:33
Get size of selected image in bytes
private void showFileChooser() {
Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent, "Select Picture"), 2);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
@bansalayush
bansalayush / CloneTest.java
Created February 28, 2017 05:58
Cloning example and concept
/*
* Cloning creates an exact copy of the object
* While using = as in the example it creates a reference to same memory location but with different name
*/
import java.io.PrintStream;
public class CloneTest {
public static void main(String[] arrstring) throws Exception {
/*t1*/TestClass testClass1 = new TestClass(8798, 540.321);
/*t2*/TestClass testClass2 = (TestClass)testClass1.clone();