Skip to content

Commit

Permalink
Added shareImage in UtilFunctions.java - Added raw sound files
Browse files Browse the repository at this point in the history
  • Loading branch information
ham3da committed Apr 8, 2020
1 parent 09ba67f commit 525c05d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions app/src/main/java/ir/ham3da/darya/utility/UtilFunctions.java
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,23 @@ public void openWhatsApp() {
}
}

public static void shareImage(Context context, Uri imageUri) {
try {

StrictMode.VmPolicy.Builder builder = new StrictMode.VmPolicy.Builder();
StrictMode.setVmPolicy(builder.build());

Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("image/*");
intent.putExtra(Intent.EXTRA_STREAM, imageUri);
context.startActivity(Intent.createChooser(intent, context.getString(R.string.share)));

} catch (Exception e)
{
Log.e("shareImage", "shareImage: "+e.getMessage() );
Toast.makeText(context, e.getMessage(), Toast.LENGTH_SHORT).show();
}
}


public void shareApp() {
Expand Down
Binary file added app/src/main/res/raw/error3.mp3
Binary file not shown.
Binary file added app/src/main/res/raw/valid2.mp3
Binary file not shown.

0 comments on commit 525c05d

Please sign in to comment.