title: Android sharing image not working
body: <p>I'm trying to share an image in an app I have made that downloads an Image and writes it to a file. But any time I try to share it, it says can't upload file or just does nothing. It's not coming up in the logcat so I'm kinda stuck for ideas on how to fix it.</p>
  
  <p>The image that is downloaded is displayed in an image view like this</p>
  
  <pre><code>        iView.setImageBitmap(im);
          String path = ContentFromURL.Storage + "/temp.jpg";
          File temp = new File(path);
          uri = Uri.fromFile(temp);
          iView.setImageURI(uri);
  </code></pre>
  
  <p>Asynch task to download file </p>
  
  <pre><code>    HttpURLConnection connection;
      try {
          String url = params[0];
          connection = (HttpURLConnection) new URL(url).openConnection();
          connection.setRequestProperty("Accept-Charset","UTF-8");
          connection.connect();
          InputStream input = connection.getInputStream();
          image = BitmapFactory.decodeStream(input);
          File temp = new File(Storage,"temp.jpg");
          ByteArrayOutputStream bytes = new ByteArrayOutputStream();
          image.compress(Bitmap.CompressFormat.JPEG, 100, bytes);
          FileOutputStream fo = new FileOutputStream(temp);
          fo.write(bytes.toByteArray());
          fo.close();
          String path = temp.getAbsolutePath();
          Log.d("Asynch", "image shuould exist");
          SharePage.act.runOnUiThread(new Runnable()
          {
              public void run()
              {
                  SharePage.setImage(image);
              }
          }
          );
  </code></pre>
  
  <p>creating intent</p>
  
  <pre><code>    twitterIntent = new Intent(Intent.ACTION_SEND);
      twitterIntent.setClassName("com.twitter.android",packageName);
      twitterIntent.setType("image/jpeg");
      twitterIntent.putExtra(Intent.EXTRA_STREAM, uri);
      startActivity(twitterIntent);
  </code></pre>
  
  <p>I know that I should use the built in android share thing but its not working either when I try to share the image</p>