share intent video?

Basic Tutorials concerning: GUI, Views, Activites, XML, Layouts, Intents, ...

share intent video?

Postby xyz » Fri Jul 13, 2012 11:01 pm

hei,.im sory for my bad english,i have an code like this
Code: Select all
private Intent shareIt() {
      a.setDrawingCacheEnabled(true);
      Bitmap icon = a.getDrawingCache();
      ByteArrayOutputStream bytes = new ByteArrayOutputStream();
      icon.compress(Bitmap.CompressFormat.JPEG, 100, bytes);
      File file = new File(Environment.getExternalStorageDirectory() + File.separator + "temporary_file.jpg");
      try {
          file.createNewFile();
          FileOutputStream fo = new FileOutputStream(file);
          fo.write(bytes.toByteArray());
      } catch (IOException e) {                       
              e.printStackTrace();
      }
      
      Intent shareIntent = new Intent(android.content.Intent.ACTION_SEND);
      shareIntent.setType("image/png");
      shareIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
   Uri uri = Uri.parse("file:///sdcard/temporary_file.jpg");
      shareIntent.putExtra(Intent.EXTRA_STREAM, uri);
      startActivity(Intent.createChooser(shareIntent, "Share via"));
      return shareIntent;
   }    
    

the code is for share image using share intent,
and the problem is ,how to share video using share intent like that code??
variable a on that code is imageview,i use video view to share video but on getDrawingCache() is not suported with videoview,..any sugest for that problem,..??

thanks before,.
xyz
Once Poster
Once Poster
 
Posts: 1
Joined: Fri Jul 13, 2012 10:38 pm

Top

Return to Novice Tutorials

Who is online

Users browsing this forum: anchal and 6 guests