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




<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. [windows驱动]windows8.1驱动调试前戏

    人们都说在干正事之前,得先做足前戏才会爽,我一直很认同这个观点,下面我来总结下进行windows8.1的WDK调试所要做的准备工作. 软件安装: 1.VS2013. 2.WDK8.1 3.Window ...

  2. HDU 1045 - Fire Net (最大独立集)

    题意:给你一个正方形棋盘.每个棋子可以直线攻击,除非隔着石头.现在要求所有棋子都不互相攻击,问最多可以放多少个棋子. 这个题可以用搜索来做.每个棋子考虑放与不放两种情况,然后再判断是否能互相攻击来剪枝 ...

  3. cometd的js端代码

    一:js端使用方式 CometD JavaScript的配置.整个API可以通过一个单一的原型名为org.cometd.Cometd的对象来调用.Dojo工具包中有一个名称为dojox.cometd的 ...

  4. 解决办法:在指定的 DSN 中,驱动程序和应用程序之间的体系结构不匹配 问题解决 SQLSTATE=IM014

    环境:64位win7,64位MySql 解决办法:32为和64位ODBC都安装上即可.

  5. python03函数、递归

    本节内容 1. 函数基本语法及特性 2. 参数与局部变量 3. 返回值 4.递归 5.匿名函数 6.函数式编程介绍 7.高阶函数 8.内置函数 1.函数基本语法及特性 函数是什么? 函数一词来源于数学 ...

  6. Linux内核中关于内存的数据结构

    物理页面 /* * Try to keep the most commonly accessed fields in single cache lines * here (16 bytes or gr ...

  7. 数据结构 《5》----二叉搜索树 ( Binary Search Tree )

    二叉树的一个重要应用就是查找. 二叉搜索树 满足如下的性质: 左子树的关键字 < 节点的关键字 < 右子树的关键字 1. Find(x) 有了上述的性质后,我们就可以像二分查找那样查找给定 ...

  8. “Compiled” Python files

    To speed up loading modules, Python caches the compiled version of each module in the __pycache__ di ...

  9. 将byte[]数组数据转换为图片用于预览显示

    假如服务器返回给你的图片信息是byte[] 然后你需要将起转换成图片显示到你的view中去: 按以下的步骤 1.将获取的byte数组保存 假如为temp[]; 2.将temp[]转化为bitmap,你 ...

  10. jqGrid详解及高级应用(十四)

    一:jqGrid 是一个用来显示网格数据的jQuery插件,文档比较全面,附带中文版本.  二:官方主页http://www.jqgrid.com/目前最新版本:jqGrid 3.7 Beta在线文档 ...