效果-=--------------》
加入包




<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"

xmlns:tools="http://schemas.android.com/tools"

android:layout_width="match_parent"

android:layout_height="match_parent"

android:orientation="vertical"

tools:context="${relativePackage}.${activityClass}" >

<!-- 当width和heigh设置0时  
weight表示 渲染的权重     当不指定值时代表的 优先级    默认是1  值越大 优先级越低 -->

<com.loopj.android.image.SmartImageView

android:layout_weight="1000"

android:id="@+id/siv"

android:layout_width="fill_parent"

 android:layout_height="fill_parent" />

<EditText

android:singleLine="true"

android:text="http://img0.bdstatic.com/img/image/shouye/dengni47.jpg"

android:id="@+id/et"

android:layout_width="fill_parent"

android:layout_height="wrap_content"

android:hint="请输入图片路径" /><!-- 提示 -->

<Button

android:onClick="click"

android:layout_width="fill_parent"

android:layout_height="wrap_content"

android:hint="浏览图片"/>

</LinearLayout>

-------------------------------------------------------------------------------------------------------------

public class MainActivity extends Activity
{

private EditText et_path;

@Override

protected void onCreate(Bundle savedInstanceState)
{

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_main);

et_path =
(EditText) findViewById(R.id.et);

}

public void click(View
view)

{

SmartImageView siv = (SmartImageView) findViewById(R.id.siv);

siv.setImageUrl(et_path.getText().toString().trim(),
R.drawable.ic_launcher,
R.drawable.ic_launcher);

}

}

版权声明:本文为博主原创文章,未经博主允许不得转载。

Android项目——网络图片查看器的更多相关文章

  1. Android smartimageview网络图片查看器

    调用代码: SmartImageView siv = (SmartImageView) findViewById(R.id.siv);siv.setImageUrl(et_path.getText() ...

  2. Android 网络图片查看器

    今天来实现一下android下的一款简单的网络图片查看器 界面如下: 代码如下: <LinearLayout xmlns:android="http://schemas.android ...

  3. 无废话Android之内容观察者ContentObserver、获取和保存系统的联系人信息、网络图片查看器、网络html查看器、使用异步框架Android-Async-Http(4)

    1.内容观察者ContentObserver 如果ContentProvider的访问者需要知道ContentProvider中的数据发生了变化,可以在ContentProvider 发生数据变化时调 ...

  4. android 网络_网络图片查看器

    xml <?xml version="1.0"?> -<LinearLayout tools:context=".MainActivity" ...

  5. Android -- 网络图片查看器,网络html查看器, 消息机制, 消息队列,线程间通讯

    1. 原理图 2. 示例代码 (网络图片查看器) (1)  HttpURLConnection (2) SmartImageView (开源框架:https://github.com/loopj/an ...

  6. Android 网络图片查看器与网页源码查看器

    在AndroidManifest.xml里面先添加访问网络的权限: <uses-permission android:name="android.permission.INTERNET ...

  7. 黎活明8天快速掌握android视频教程--23_网络通信之网络图片查看器

    1.首先新建立一个java web项目的工程.使用的是myeclipe开发软件 图片的下载路径是http://192.168.1.103:8080/lihuoming_23/3.png 当前手机和电脑 ...

  8. Android 网络HTML查看器

    本文实现一个基于Android的网络HTML查看器 新建项目,项目布局文件如下: <LinearLayout xmlns:android="http://schemas.android ...

  9. Android简易实战教程--第二十六话《网络图片查看器在本地缓存》

    本篇接第二十五话  点击打开链接   http://blog.csdn.net/qq_32059827/article/details/52389856 上一篇已经把王略中的图片获取到了.生活中有这么 ...

随机推荐

  1. java基础-005

    27.Java中垃圾回收的目的及回收的时机 垃圾回收的目的是识别并且丢弃不再使用的对象来释放和重用资源. 如果对象的引用被置为null,垃圾收集器不会立即释放对象占用的内存. 什么时候进行垃圾回收,主 ...

  2. goldengate 12c对oracle DB的改进

    1. 现在可使用Oracle Universal Installer,即安装时有图形化界面,同时会自动安装java runtime environment,不过个人认为,还是ZIP安装包方便,解压即用 ...

  3. 转:Java面试题集(1-50)

    Java程序员面试题集(1-50) http://blog.csdn.net/jackfrued/article/details/17403101 一.Java基础部分 1.面向对象的特征有哪些方面? ...

  4. FragmentActivity+FragmentTabHost+Fragement instead of TabActibvity+TabHost+Activity

    http://www.tuicool.com/articles/NzeMJz http://www.tuicool.com/articles/FJ7VBb FragmentTabHost切换Fragm ...

  5. hdu 2048

    PS:WA了两次...主要是没注意到fac的大小好像只能写到9...要用long long型递归求阶乘... 然后就是错排公式...百度下.. 代码: #include "stdio.h&q ...

  6. Java容器类接口的选择

    我们知道Java容器类实际提供了四类接口:Map,List,Set和Queue,如下图所示,每种接口都有不止一个版本的实现,如果在实际编写程序时需要使用某种接口时该如何选择. 从Oracle的Java ...

  7. swift系统学习第三章

    第九节:结构体-sturt //: Playground - noun: a place where people can play import UIKit /* swift学习第九节 结构体:st ...

  8. BUY LOW, BUY LOWER_最长下降子序列

    Description The advice to "buy low" is half the formula to success in the bovine stock mar ...

  9. Android无限循环轮播广告位Banner

     Android无限循环轮播广告位Banner 现在一些app通常会在头部放一个广告位,底部放置一行小圆圈指示器,指示广告位当前的页码,轮播展示一些图片,这些图片来自于网络.这个广告位banner ...

  10. 郝斌老师的SQL教程

    时隔两年,重拾数据库编程.郝斌老师的sql教程通俗易懂,用作复习简直不能太赞.