Skip to content

Instantly share code, notes, and snippets.

View gist:e2cb6a904aa79b0ed746
EditText input = ...
InputFilter[] FilterArray = new InputFilter[1];
FilterArray[0] = new InputFilter.LengthFilter(limit);
input.setFilters(FilterArray);
View gist:be47c5ab12fb3ae6e8a3
class Program
{
static void Main(string[] args)
{
int row = 0;
int[,] xoarrey = new int[,]{ { 0, 1, 2 }, { 0, 2, 0 } ,{ 0, 1, 1 } };
for (int i = 0; i < 5; i++) {
if (i % 2 == 0)
{
@Collosteam
Collosteam / gist:ffcdfcf6cf10f737a280
Created Oct 23, 2014
Android Uri to File new API (11+)
View gist:ffcdfcf6cf10f737a280
public String getRealPathFromURI(Context context, Uri contentUri) {
Cursor cursor = null;
try {
String[] projection = {MediaStore.Images.Media.DATA};
cursor = context.getContentResolver().query(contentUri, projection, null, null, null);
int column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
cursor.moveToFirst();
return cursor.getString(column_index);
} finally {
if (cursor != null) {
View Android Uri to File
File file = new File(getPath(uri));
public String getPath(Uri uri)
{
String[] projection = { MediaStore.Images.Media.DATA };
Cursor cursor = managedQuery(uri, projection, null, null, null);
if (cursor == null) return null;
int column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
cursor.moveToFirst();
View Best_Buttons_The-android_.classpath
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="src" exported="true" path="/Best_Buttons_The" combineaccessrules="false"/>
<classpathentry kind="output" path="bin/classes"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry kind="lib" exported="true" path="/Best_Buttons_The/libs/gdx.jar" sourcepath="/Best_Buttons_The/libs/gdx-sources.jar"/>
<classpathentry kind="lib" exported="true" path="libs/gdx-backend-android.jar" sourcepath="libs/gdx-backend-android-sources.jar"/>
View Best_Buttons_The-android_.classpath
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="src" exported="true" path="/Best_Buttons_The" combineaccessrules="false"/>
<classpathentry kind="output" path="bin/classes"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry kind="lib" exported="true" path="/Best_Buttons_The/libs/gdx.jar" sourcepath="/Best_Buttons_The/libs/gdx-sources.jar"/>
<classpathentry kind="lib" exported="true" path="libs/gdx-backend-android.jar" sourcepath="libs/gdx-backend-android-sources.jar"/>
View Best_Buttons_The-android_.classpath
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="src" exported="true" path="/Best_Buttons_The" combineaccessrules="false"/>
<classpathentry kind="output" path="bin/classes"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry kind="lib" exported="true" path="/Best_Buttons_The/libs/gdx.jar" sourcepath="/Best_Buttons_The/libs/gdx-sources.jar"/>
<classpathentry kind="lib" exported="true" path="libs/gdx-backend-android.jar" sourcepath="libs/gdx-backend-android-sources.jar"/>