摘要: 如果是从BroadcastReceiver 启动一个新的Activity , 不要忘记i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);public class MyReceiver extends BroadcastReceiver{ public static final String action="acc"; public void onReceive(Context context, Intent intent) { Intent i=new Intent(context,Receivered.class); i.setFlags 阅读全文
posted @ 2012-03-31 22:26 与时俱进 阅读(1783) 评论(0) 推荐(0) 编辑
摘要: BaseAdapterJava代码 public class RecentAdapter extends BaseAdapter { private class RecentViewHolder { TextView appName; ImageView appIcon; TextView appSize; } private List<ResolveInfo> mAppList; private LayoutInflater mInflater; private PackageManager pm; public RecentAdapter(C... 阅读全文
posted @ 2012-03-31 22:11 与时俱进 阅读(1341) 评论(0) 推荐(1) 编辑
摘要: 最近做一个项目,项目中用到了ListView,ListView最重要的就是绑定数据,这个数据由Adapter来提供,这里我重写了BaseAdapter这个类来实现自己的menuAdapter代码如下:package org.leepood.lanorder;import java.io.InputStream;import java.util.ArrayList;import java.util.List;import org.leepood.xmlparse.xmlParse;import android.view.LayoutInflater;import android.content. 阅读全文
posted @ 2012-03-31 21:59 与时俱进 阅读(11140) 评论(0) 推荐(1) 编辑
摘要: 1. 使用 PHP 获得网页内容 GET方式<?phpfunction socketGet($url, &$ret){$urlArr = parse_url($url);$host = $urlArr['host'];$port = isset($urlArr['port'])?$urlArr['port']:80;$path = isset($urlArr['path'])?$urlArr['path']:"/";$fp = fsockopen($host, $port, $er 阅读全文
posted @ 2012-03-31 21:48 与时俱进 阅读(1257) 评论(0) 推荐(1) 编辑
摘要: //选择图片 requestCode 返回的标识Intent innerIntent = new Intent(Intent.ACTION_GET_CONTENT); //"android.intent.action.GET_CONTENT"innerIntent.setType(contentType); //查看类型 String IMAGE_UNSPECIFIED = "image/*";Intent wrapperIntent = Intent.createChooser(innerIntent, null);((Activity) contex 阅读全文
posted @ 2012-03-31 21:45 与时俱进 阅读(1828) 评论(0) 推荐(0) 编辑
摘要: 具体代码如下:第一步:try { Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); startActivityForResult(intent, 0); } catch (ActivityNotFoundException e) { // Do nothing for now }第二步:@Overrideprotected void onActivityResult(int requestCode, int resultCode, Intent data) { try { if (requestCode != 0) {.. 阅读全文
posted @ 2012-03-31 21:43 与时俱进 阅读(282) 评论(0) 推荐(0) 编辑
摘要: 看到很多热门的Android程序(如:新浪微博、腾讯微博、京东商城、淘宝、当当等等)使用选项卡风格作为程序界面的主框架结构,而Android的选项卡控件默认是按钮在上方的。我在网上看到有多种实现方法,这里提供一种个人觉得比较简单的。由于我对Android开发所知甚少,方法的优劣目前不好评价,欢迎各位提供更好的思路。主要原理:设置 TabWidget 控件的 android:layout_alignParentBottom="true" 实现。main.xml<?xml version="1.0" encoding="utf-8" 阅读全文
posted @ 2012-03-31 21:24 与时俱进 阅读(2871) 评论(0) 推荐(0) 编辑
友情链接:同里老宅院民居客栈