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




<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. Linux内核-链表

    linux内核链表的定义(定义了双向链表,不含数据域) 定义在 /linux-source-3.13.0/include/linux/types.h 头文件中. struct list_head { ...

  2. Android开发-开发前的配置

    一.JDK   (不用安装) JDK是 java 语言的软件开发工具,主要用于移动设备.嵌入式设备上的java应用程序. JDK是整个java开发的核心,它包含了JAVA的运行环境,JAVA工具和JA ...

  3. 《foreach循环示例》

    //foreach测试 public class ForEachTest { public static void main(String[] args) { String[] books = {&q ...

  4. poj1845 数论

    //Accepted 204K 16MS //约数和 //n=p1^e1*p2^e2***pk^ek //约数和为:(p1^0+p1^1+..+p1^e1)*(p2^0+p2^1+..+p2^e2)* ...

  5. Oracle普通索引,唯一索引,主键的区别

    索引是我们经常使用的一种数据库优化手段,适当的业务操作场景使用适当的索引方案,可以显著的提升系统整体查询性能,当然用户体验也随之提高. 在Oracle中,唯一性索引(Unique Index)是我们经 ...

  6. Java Inner class && nested class

    Java中,Inner Class(不被 static修饰)可以访问outer class 的所有成员(包括私有成员),同时,内部类 的创建必须经由外部类的实例! nested class 有stat ...

  7. Chapter 3: Connector(连接器)

    一.概述 Tomcat或者称之为Catalina(开发名称),可以简化为两个主要的模块,如下图: 多个Connector关联一个Container.之所以需要多个Connector,是为了处理多种协议 ...

  8. maven3在eclipse3.4.2中创建java web项目

    学习maven时参考的一些的博客地址:http://www.cnblogs.com/fnng/archive/2011/12/16/2290587.htmlhttp://sarin.iteye.com ...

  9. SQL Server LEFT Functions

    LEFT(string, n)函数,是处理字符数据获取子字符串.第一个参数是将要处理的字符串,第二个参数,是从字符串的左边开始截取的字符个数. 例子: DECLARE @string NVARCHAR ...

  10. compare:(字符串的大小比较)

    1.字符串的比较是按照ascall码进行比较的 比如A比a的值小, if([string1 compare:string2] == (以下描述)) 如果比较的结果是NSOrderedDescendin ...