Android项目——网络图片查看器
效果-=--------------》加入包


<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项目——网络图片查看器的更多相关文章
- Android smartimageview网络图片查看器
调用代码: SmartImageView siv = (SmartImageView) findViewById(R.id.siv);siv.setImageUrl(et_path.getText() ...
- Android 网络图片查看器
今天来实现一下android下的一款简单的网络图片查看器 界面如下: 代码如下: <LinearLayout xmlns:android="http://schemas.android ...
- 无废话Android之内容观察者ContentObserver、获取和保存系统的联系人信息、网络图片查看器、网络html查看器、使用异步框架Android-Async-Http(4)
1.内容观察者ContentObserver 如果ContentProvider的访问者需要知道ContentProvider中的数据发生了变化,可以在ContentProvider 发生数据变化时调 ...
- android 网络_网络图片查看器
xml <?xml version="1.0"?> -<LinearLayout tools:context=".MainActivity" ...
- Android -- 网络图片查看器,网络html查看器, 消息机制, 消息队列,线程间通讯
1. 原理图 2. 示例代码 (网络图片查看器) (1) HttpURLConnection (2) SmartImageView (开源框架:https://github.com/loopj/an ...
- Android 网络图片查看器与网页源码查看器
在AndroidManifest.xml里面先添加访问网络的权限: <uses-permission android:name="android.permission.INTERNET ...
- 黎活明8天快速掌握android视频教程--23_网络通信之网络图片查看器
1.首先新建立一个java web项目的工程.使用的是myeclipe开发软件 图片的下载路径是http://192.168.1.103:8080/lihuoming_23/3.png 当前手机和电脑 ...
- Android 网络HTML查看器
本文实现一个基于Android的网络HTML查看器 新建项目,项目布局文件如下: <LinearLayout xmlns:android="http://schemas.android ...
- Android简易实战教程--第二十六话《网络图片查看器在本地缓存》
本篇接第二十五话 点击打开链接 http://blog.csdn.net/qq_32059827/article/details/52389856 上一篇已经把王略中的图片获取到了.生活中有这么 ...
随机推荐
- [microsoft]PE和COFF文件格式
前言 我们知道,vs的C/C++编译工具把每一个编译单元(一个.c或.cpp源文件)编译成一个对象文件(.obj文件):然后用链接器把这些对象文件组合一个单个文件(.exe文件),称为可移植的可执行文 ...
- 修改Oracle数据库的字符集为UTF-8
1.改客户端字符集:通过WINDOWS的运行菜单运行Regedit,修改注册表 Start -> Run -> Rededit <-| Under registry Editor - ...
- 《JAVA学习笔记 (final关键字)》
[14-9]面向对象-final关键字 /* 继承的弊端,打破封装性. 不让其他类继承该类,就不会有重写. 怎么能实现呢?通过Java中的一个关键子来实现,final(最终化). [final关键字] ...
- 《JAVA学习笔记(1---13-4)》
[1]问题: 1.什么叫做面向过程? 2.什么叫做面向对象? 解答: 1: 所谓的面向过程就是我们是一个执行者,我们要开发一个项目,这个项目要求要实现很多功能,作为执行者的我们就需要 去一个一个的找这 ...
- EditText提示文字
如图,在没有输入文字前,会显示提醒文字. 引用的是文本文件(strings.xml)中的对应文字 activity_main.xml对应的红色代码: <?xml version="1. ...
- org.springframework.validation.BindException: org.springframework.validation.BeanPropertyBindingResult: 1 errors
最近在项目中发现如下异常: 六月 25, 2015 5:58:34 下午 org.apache.catalina.core.StandardWrapperValve invoke严重: Servlet ...
- C++除法取整
使用floor函数.floor(x)返回的是小于或等于x的最大整数.如: floor(2.5) = 2 floor(-2.5) = -3 使用ceil函数.ceil(x)返回的是大于x的最小整 ...
- 在某个目录下的所有文件中查找包含某个字符串的Windows命令
findstr可以完成这个工作. 上面的命令表示,当前目录以及当前目录的所有子目录下的所有文件中查找"string"这个字符串. *.*表示所有类型的文件. /s 表示当前目录 ...
- 前端页面js与flash交互——js获取flash对象,并传递参数
背景介绍: 最近在搞一个项目,涉及到图片选取,裁剪,上传等,由于浏览器安全性问题,js无法获取到<input type="file">中选取的文件路径,而且对照片的裁剪 ...
- PHP实现简单计算器
<!--简单的计算器--> <!DOCTYPE html> <html> <head> <title>PHP实现简单计算器</titl ...