当前位置: 代码迷 >> Android >> 各位大牛帮忙看看,设断点运行两次成功,不设断点运行不成功!
  详细解决方案

各位大牛帮忙看看,设断点运行两次成功,不设断点运行不成功!

热度:90   发布时间:2016-05-01 21:08:29.0
求救各位大牛帮忙看看,设断点运行两次成功,不设断点运行不成功!!
如题:设断点运行两次成功,不设断点运行不成功!!帮忙看看到底出来时什么问题
[code=Java][/code]package com.cooby;

import java.util.ArrayList;

import java.util.HashMap;

import java.util.List;
import java.util.Map;

import com.cooby.R;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;

import android.graphics.Color;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;

import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;

import android.widget.Button;
import android.widget.HorizontalScrollView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.SimpleAdapter;

import android.widget.TextView;

public class kccx extends Activity {

ArrayList<String[]> alType = null;// 将所有对象存储在arraylist
ArrayList<HashMap<String, String>> mylist = null;

MyConnector mc = null; // 网络连接器对象
ListView lv = null;
SpecialAdapter adapter = null;
Handler myhandler = new Handler() {
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
case 0:

lv.setAdapter(adapter);
break;
}
super.handleMessage(msg);

}
};

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.kccx);
setTitle("库存查询");
getContact();

adapter = new SpecialAdapter(this, mylist, R.layout.kccx, new String[] {
"encode", "name", "pyin", "mun", "dwei" }, new int[] {
R.id.a07_ls_txtSNSRE, R.id.a07_ls_txtYNSE, R.id.a07_ls_txtSNSE,
R.id.a07_ls_txtXXSR, R.id.a07_ls_txtYF });
TextView t1 = new TextView(this);
t1.setText("产品编码");
t1.setBackgroundResource(R.drawable.kuang9);
TextView t2 = new TextView(this);
t2.setText("产品名称");
t2.setBackgroundResource(R.drawable.kuang9);
TextView t3 = new TextView(this);
t3.setText("产品简称");
t3.setBackgroundResource(R.drawable.kuang9);
TextView t4 = new TextView(this);
t4.setText("数量");
t4.setBackgroundResource(R.drawable.kuang9);
TextView t5 = new TextView(this);
t5.setText("单位");
t5.setBackgroundResource(R.drawable.kuang9);
LinearLayout linear = new LinearLayout(this);
linear.addView(t1, 79, 45);
linear.addView(t2, 100, 45);
linear.addView(t3, 80, 45);
linear.addView(t4, 80, 45);
linear.addView(t5, 60, 45);

lv = new ListView(this);

lv.setHorizontalScrollBarEnabled(true);
lv.addHeaderView(linear);// 设置listHeader 始终位于列表顶部

HorizontalScrollView hsv = new HorizontalScrollView(this);
hsv.addView(lv);
setContentView(hsv);

// lv.setAdapter(adapter);

}

public class SpecialAdapter extends SimpleAdapter {
private int[] colors = new int[] { 0x30FF0000, 0x300000FF };

public SpecialAdapter(Context context,
List<? extends Map<String, ?>> data, int resource,
String[] from, int[] to) {

super(context, data, resource, from, to);

}

@Override
public View getView(int position, View convertView, ViewGroup parent) {
View view = super.getView(position, convertView, parent);
int colorPos = position % colors.length;
if (colorPos == 1) {
view.setBackgroundColor(Color.argb(250, 255, 255, 255));
} else {
view.setBackgroundColor(Color.argb(250, 224, 243, 250));
}
return view;
}
}

public void getContact() {
  相关解决方案