上一页 1 ··· 23 24 25 26 27 28 29 30 31 ··· 35 下一页
摘要: 1、主代码:public static String uploadFile(String path, File file, Map map, String encode) { String result = null; String BOUNDARY = UUID.randomUUID().toString(); // 边界标识 随机生成 String PREFIX = "--", LINE_END = "\r\n"; String CONTENT_TYPE = "multipart/form-data"; // 内... 阅读全文
posted @ 2013-10-29 13:09 行云有影 阅读(1798) 评论(0) 推荐(0) 编辑
摘要: 1、主代码login:(1)传递Map参数能具有更好的复用性import org.apache.http.HttpEntity;import org.apache.http.HttpResponse;import org.apache.http.NameValuePair;import org.apache.http.client.ClientProtocolException;import org.apache.http.client.HttpClient;import org.apache.http.client.entity.UrlEncodedFormEntity;import org 阅读全文
posted @ 2013-10-29 12:40 行云有影 阅读(267) 评论(0) 推荐(0) 编辑
摘要: 线程的起动并不是简单的调用了你的RUN方法,而是由一个线程调度器来分别调用你的所有线程的RUN方法,我们普通的RUN方法如果没有执行完是不会返回的,也就是会一直执行下去,这样RUN方法下面的方法就不可能会执行了,可是线程里的RUN方法却不一样,它只有一定的CPU时间,执行过后就给别的线程了,这样反复的把CPU的时间切来切去,因为切换的速度很快,所以我们就感觉是很多线程在同时运行一样.你简单的调用run方法是没有这样效果的,所以你必须调用Thread类的start方法来启动你的线程.所以你启动线程有两种方法一是写一个类继承自Thread类,然后重写里面的run方法,用start方法启动线程二是写 阅读全文
posted @ 2013-10-29 11:55 行云有影 阅读(164) 评论(0) 推荐(0) 编辑
摘要: * 二者比较明显handler速度要快一点* 如果异步任务的数据特别庞大,AsyncTask这种线程池结构的优势就体现出来了。public class MainActivity extends Activity { private Button button1, button2;private Dialog dialog; private ProgressDialog progressDialog; String path = "http://g.hiphotos.baidu.com/album/w%3D2048/sign=d6ae435755e736d158138b08af... 阅读全文
posted @ 2013-10-26 16:47 行云有影 阅读(215) 评论(0) 推荐(0) 编辑
摘要: 1、普通Notification和自定义布局的Notification:(1)如果不是在activity显示通知,但有传context,则manager=(NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE);package com.example.mynotification;import android.app.Activity;import android.app.Notification;import android.app.NotificationManager;import androi 阅读全文
posted @ 2013-10-26 16:34 行云有影 阅读(399) 评论(0) 推荐(0) 编辑
摘要: 1、布局文件:(1)主布局:放置一个ExpandableListView组件(2)每一行的Item布局,child_listitem.xml: 2、代码清单:主代码:import java.util.ArrayList;import java.util.HashMap;import java.util.List;import java.util.Map;import android.os.Bundle;import android.support.v4.app.Fragment;import android.view.LayoutInflater;import android.v... 阅读全文
posted @ 2013-10-26 16:20 行云有影 阅读(622) 评论(0) 推荐(0) 编辑
摘要: 1、两个布局文件: (1)主布局文件activity_main.xml:放置ListView组件即可 (2)列表的item.xml文件(每一行的布局):如一个横向LinearLayout布局文件 2、主代码: public class WillListAdapter extends BaseAdap 阅读全文
posted @ 2013-10-26 15:24 行云有影 阅读(1838) 评论(0) 推荐(0) 编辑
摘要: 1、解压文件:tar zxvf *.tar.gz2、安装“此处打开终端:sudoapt-getinstallnautilus-open-terminal 阅读全文
posted @ 2013-10-26 01:05 行云有影 阅读(119) 评论(0) 推荐(0) 编辑
摘要: 1、getString(R.string.error_field_required) 阅读全文
posted @ 2013-10-22 17:16 行云有影 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 1、主xml文件: 将选项卡修改到底部的方法:TabWidget移至FrameLayout的下面FrameLayout修改至android:layout_height="0dp"android:layout_weight="1"2、主代码:TabHost tabHost = (TabHost) findViewById(android.R.id.tabhost); tabHost.setup(); tabHost.addTab(tabHost... 阅读全文
posted @ 2013-10-22 09:05 行云有影 阅读(387) 评论(0) 推荐(0) 编辑
上一页 1 ··· 23 24 25 26 27 28 29 30 31 ··· 35 下一页