Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
gzeinnumer authored Mar 7, 2021
1 parent 0b535a5 commit e3f0b50
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,14 +203,25 @@ Log.d(TAG, "onCreate_7: "+ result_7); // 663219154.png
//Remove Extension
String result_8 = MBUtilsString.removeExtension(result_7);
Log.d(TAG, "onCreate_8: "+ result_8); // 663219154

//Remove Extension
Uri fileUri = data.getData();
String filePath = null;
try {
filePath = MBUtilsString.getPath(getApplicationContext(), fileUri);
} catch (Exception e) {
Toast.makeText(getApplicationContext(), "Error: " + e, Toast.LENGTH_SHORT).show();
```
Get File Path
```java
//get File Path
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {

...

Uri fileUri = data.getData();
String filePath = null;
try {
filePath = MBUtilsString.getPath(getApplicationContext(), fileUri);
} catch (Exception e) {
Toast.makeText(getApplicationContext(), "Error: " + e, Toast.LENGTH_SHORT).show();
}

...

}
```

Expand Down

0 comments on commit e3f0b50

Please sign in to comment.