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
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(); |
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 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) { |
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 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) | |
{ |
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
EditText input = ... | |
InputFilter[] FilterArray = new InputFilter[1]; | |
FilterArray[0] = new InputFilter.LengthFilter(limit); | |
input.setFilters(FilterArray); |