Is this code correct? | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
- 1

Is this code correct?

Bitmap bitmap =BitmapFactory. decodeResource(getResources(),R. drawable.image2); string path=getExternal() +"/shareimage. Jpg"; java.io.OutputStream out=null; java.io.File file =new java.io. File (path);try {out=new java.io. FileOutputStream(file); bitmap.Compress (bitmap.Compress. JPEG, 100, out);Out.flush();out.close();} catch (Exception e) {e.printStackTrace();} Path=file.getPath(); Uri bmpUri=Uri.parse("file://" +path); Intent shareIntent=NEW; Intent(); shareIntent=NEW; Intent(android.content.Intent.ACTION_SEND); ShareIntent.setFlags.Intent. FLAG_ ACTIVITY_NEW_TASK; ShareIntent; putExtra(Intent. EXTRA_STREAM, Uri); shareIntent. SetType("image/jpg"); StartActivity (Intent. createChooser(shareIntent, "Share with")) ;

8th Feb 2021, 7:39 PM
Ahmed Jaafari
Ahmed Jaafari - avatar
1 Antwort
+ 1
It would be much better if you could use code playground to share your code, it's much more readable that way
9th Feb 2021, 2:20 AM
Sattar
Sattar - avatar