- 博客(9)
- 资源 (4)
- 收藏
- 关注
转载 Android 实现Activity后台运行
此方法其实不是主要是屏蔽Keycode_Back,让它不结束(finish())Activity,直接显示HOME界面。 Java代码 PackageManager pm = getPackageManager(); ResolveInfo homeInfo = pm.resolveActivity(new Intent(Intent.ACTION_M
2011-12-21 16:47:32 536
转载 浅谈android的selector,背景选择器
关于listview和button都要改变android原来控件的背景,在网上查找了一些资料不是很全,所以现在总结一下android的selector的用法。首先android的selector是在drawable/xxx.xml中配置的。先看一下listview中的状态:把下面的XML文件保存成你自己命名的.xml文件(比如list_item_bg.xml),在系统使用时根据List
2011-12-16 23:24:49 281
转载 Android 自定义Button按钮显示样式(正常、按下、获取焦点)
现在的用户对APP的外观看得很重要,如果APP内所有元件都用Android默认样式写,估计下面评论里就有一堆在骂UI丑的。今天学习自定义Button按钮样式。Button样式修改的是Button的背景(Background)属性。首先写一个定义Button样式的XML文件:新建Android XML文件,类型选Drawable,根结点选selector,文件名就buton_style吧。
2011-12-16 23:17:06 808
转载 两个HorizontalScrollView一起滚动
定义一个新View,继承HorizontalScrollView,覆盖onScrollChanged方法。import android.content.Context;import android.util.AttributeSet;import android.view.View;import android.widget.HorizontalScrollView;publ
2011-12-16 21:49:39 2268
转载 Android带进度条文件上传
Being able to display a progress bar during a time consuming upload to a web server is important when dealing with users and appeasing their impatience. Here is one approach of achieving this.In t
2011-12-15 21:24:19 15519 13
原创 无语的ClassCastException
今天在调试android程序的时候,出现了莫名其妙的ClassCastException。程序很简单,布局文件里有个EditText,id叫username_edit,然后在Activity里通过(EditText)findViewById(R.id.username_edit)来获取。但是运行的时候居然抛出了ClassCastException,无语啊,百思不得其解。后来在StackOver
2011-12-14 19:04:26 693
转载 HttpClient4文件上传
httpclient上传文件实际上就是模拟一个http的表单提交请求。 Java代码 package test.httpclient4; import java.io.File; import java.io.IOException; import org.apache.http.HttpEntity; import org
2011-12-04 21:38:48 1478
转载 HttpClient 3.1 文件上传
客户端:需要commons-codec,commons-httpclient-3.1,commons-logging-1.1.1 String targetURL = null;// TODO 指定URL File targetFile = null;// TODO 指定上传文件 targetFile = new File("C:\\
2011-12-04 15:01:05 1612
原创 HttpClient基本用法
Get方式:String url="http://localhost:8080/HttpClientDemo/test"; HttpGet httpRequest=new HttpGet(url); HttpClient httpClient=new DefaultHttpClient(); HttpResponse response=httpClient.execute(h
2011-12-04 14:47:13 6056
reactive design patterns
2018-06-11
零售管理 第6版 高清 带索引书签目录
2018-05-07
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人