CopyPastor

Detecting plagiarism made easy.

Score: 0.8358724206407494; Reported for: String similarity Open both answers

Possible Plagiarism

Plagiarized on 2018-04-08
by Rujel

Original Post

Original - Posted on 2010-08-05
by Miša Peić



            
Present in both answers; Present only in the new answer; Present only in the old answer;

public String getRealPathFromURI(Context context, Uri contentUri) { String[] proj = {MediaStore.Images.Media.DATA}; CursorLoader loader = new CursorLoader(context, contentUri, proj, null, null, null); Cursor cursor = loader.loadInBackground(); int column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA); cursor.moveToFirst(); String result = cursor.getString(column_index); cursor.close(); return result; }
public String getRealPathFromURI(Context context, Uri contentUri) { Cursor cursor = null; try { String[] proj = { MediaStore.Images.Media.DATA }; cursor = context.getContentResolver().query(contentUri, proj, null, null, null); int column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA); cursor.moveToFirst(); return cursor.getString(column_index); } finally { if (cursor != null) { cursor.close(); } } }

        
Present in both answers; Present only in the new answer; Present only in the old answer;