上一页 1 ··· 85 86 87 88 89 90 91 92 93 ··· 96 下一页
摘要: public JSONObject urlConn(String urlStr, String portStr){ String port = getPort(portStr); urlStr = (urlStr != null)?(host + port + "/?" + urlStr):(host + port); int responseCode;try { url = new URL(urlStr); conn = (HttpURLConnection) url.openConnection(); responseCode = conn.getResponseCod 阅读全文
posted @ 2012-04-13 17:21 幻星宇 阅读(304) 评论(0) 推荐(0) 编辑
摘要: JSONArray jsonArr = jsonData.getJSONArray("gameList"); for (int i = 0; i < jsonArr.length(); i++) { String regionStr = ((JSONObject) jsonArr.opt(i)) .getString("language") + " " + ((JSONObject) jsonArr.opt(i)).getString("platform") + " " + ((JSONO 阅读全文
posted @ 2012-04-13 17:20 幻星宇 阅读(291) 评论(0) 推荐(0) 编辑
摘要: private LinearLayout activity_view = null;// 获得一个可扩展的layout实例 private LayoutInflater inflater = null;activity_view = (LinearLayout) findViewById(R.id.activity_view);inflater = (LayoutInflater) MainActivity.this .getSystemService(LAYOUT_INFLATER_SERVICE);// 将layout添加到view View view = inflater.inflate 阅读全文
posted @ 2012-04-13 17:17 幻星宇 阅读(224) 评论(0) 推荐(0) 编辑
摘要: /** * 加载notification内容 */ private void loadNotifiListView() { notifiListView = (ListView) findViewById(R.id.notifi_list); ArrayList list = new ArrayList(); HashMap map; map = new HashMap(); map.put("id", 1); map.put("notiIcon", R.drawable.ic_launcher); map.put("notiInfo" 阅读全文
posted @ 2012-04-13 17:15 幻星宇 阅读(242) 评论(0) 推荐(0) 编辑
摘要: /** * 获取游戏列表数据 */ private void getGameListData(String urlStr, String portStr) { ArrayList list = new ArrayList(); HashMap map; HttpConn httpConn = new HttpConn(); JSONObject jsonData = httpConn.urlConn(urlStr, portStr); try { JSONArray jsonArr = jsonData.getJSONArray("gameList"); for (int 阅读全文
posted @ 2012-04-13 17:14 幻星宇 阅读(397) 评论(0) 推荐(0) 编辑
摘要: /** * 初始化spinner下的内容 */ private void addSpinnerItem() { ArrayAdapter<String> adapter; adapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, words); adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); wordSpinner.setAdapter(adapter); ad 阅读全文
posted @ 2012-04-13 17:13 幻星宇 阅读(284) 评论(0) 推荐(0) 编辑
摘要: package com;/* * 生产类 */public class Producer implements Runnable { //开始操作数据存储类P P q = null; public Producer(P q){ this.q = q; }@Override public void run() { int i = 0; while(true){ //编写往数据存储空间放入数据的代码 if( i == 0 ){ q.set("张三", "男"); }else{ q.set("李四", "女"); } i 阅读全文
posted @ 2012-04-13 11:59 幻星宇 阅读(197) 评论(0) 推荐(0) 编辑
摘要: AutoCompleteTextView的功能类似于百度或者Google在搜索栏输入信息的时候,弹出的与输入信息接近的提示信息。 当然这里要要用到一些适配器 在Android中 提供了两智能输入框,它们是MultiAutoCompleteTextView、AutoCompleteTextView。它们的功能大致一样,它和 AutoCompleteTextView的区别就是MultiAutoCompleteTextView可以在输入框中一直增加新的选取值。编写方式也 有所不同,在进行setAdapter之后还需要调用setTokenizer() 。下面详细介绍一下。 一、AutoCompl... 阅读全文
posted @ 2012-04-12 16:40 幻星宇 阅读(428) 评论(0) 推荐(0) 编辑
摘要: package com;public class ThreadDemo {/** * @param args */ public static void main(String[] args) { //new TestThread().start();//调用Thread的start方法,实际上调用run方法 Test1Thread t = new Test1Thread();//产生Runnable接口的子类实例化 new Thread(t).start();//启动多线程 //循环输出 for( int i = 0; i < 10; i++ ){ System.out.println 阅读全文
posted @ 2012-04-12 14:40 幻星宇 阅读(189) 评论(0) 推荐(0) 编辑
摘要: 做游戏的时候遇到的问题,在CSDN问的,有人提供了好的方法,记录一下。用手指画一条路线,然后图跟着路线移动。import java.util.ArrayList;import android.content.Context; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.graphics.Path; import android.graphics.PointF; import android.view.MotionEvent 阅读全文
posted @ 2012-04-11 10:11 幻星宇 阅读(804) 评论(0) 推荐(0) 编辑
上一页 1 ··· 85 86 87 88 89 90 91 92 93 ··· 96 下一页