【问题标题】:Pass image URL to aviary image editor将图像 URL 传递给 aviary 图像编辑器
【发布时间】:2015-04-28 10:22:18
【问题描述】:

我可以将图像 URL 传递给 aviary 图像编辑器,而不是从厨房中挑选照片吗?

我试过了

Intent newIntent = new Intent(this, FeatherActivity.class);
newIntent.setData(imageURI);
startActivityForResult(newIntent, 1);

但我想要 URL 而不是 URI。

【问题讨论】:

    标签: android aviary


    【解决方案1】:

    试试这个:

    String image_url = "http://www.test.com/abc.jpg";
    Intent i = new Intent(Intent.ACTION_VIEW);
    i.setData(Uri.parse(image_url));
    startActivity(i);
    

    看看,是否可行。

    【讨论】:

      【解决方案2】:

      试试这个::

      public class ImageFromUrlExample extends Activity {
      /** Called when the activity is first created. */
      @Override
      public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.main);
      
      ImageView imgView =(ImageView)findViewById(R.id.ImageView01);
      Drawable drawable = LoadImageFromWebOperations("http://www.androidpeople.com/wp-content/uploads/2010/03/android.png");
      imgView.setImageDrawable(drawable);
      
      }
      
      private Drawable LoadImageFromWebOperations(String url)
      {
      try
      {
      InputStream is = (InputStream) new URL(url).getContent();
      Drawable d = Drawable.createFromStream(is, "src name");
      return d;
      }catch (Exception e) {
      System.out.println("Exc="+e);
      return null;
      }
      }
      }
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2016-08-07
        • 2016-05-29
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2012-10-21
        • 2015-11-22
        相关资源
        最近更新 更多