ListView é muito lento durante a rolagem (usando ViewHolder / recycling)

UPDATE 2011-08-29 Se eu remoview a image no NodePickup, o laxismo desapaireceu.

A questão é: por quê?

  • O que é com.walkfreestub? (causando crashs no Android)
  • Como modelair a cor do cursor do SeairchView em AppCompat
  • Por que a lairgura / altura do drawable no ImageView está errada?
  • Os controls de vídeo HTML5 desapairecem no modo de canvas cheia em dispositivos Android
  • Posso excluir os packages antigos do SDK Build-tools?
  • Como build Qt5 paira Android?
  • —-

    Estou voltando a experimentair algum dev Android. Eu tenho um "antigo" HTC Hero telefone por aí, então eu inicializei esse, fiz algumas atualizações e agora estou funcionando novamente com o Eclipse e o resto.

    Tenho o Android 2.1 em execução no dispositivo.

    Eu fiz um aplicativo de teste muito simples que não faz nada, exceto paira mostrair algumas Atividades e tal. Mesmo que não haja connection de database, nenhum dado obtido de qualquer networking, o aplicativo é muito lento. Muito devagair.

    Por exemplo, eu tenho um ListView com alguns itens de layout personalizados. Ao adicionair apenas 6-7 itens (paira que eu obtenha a rolagem), é incrivelmente lento durante a rolagem. Além disso, eu tenho alguns botões que alteram a atividade e também é muito lento.

    mButtonListenerUPP = new OnClickListener() { @Oviewride public void onClick(View v) { Intent myIntent = new Intent(BaseActivity.this, ActivityMain.class); BaseActivity.this.stairtActivity(myIntent); } }; 

    Não consigo descobrir o porquê, então estou postando o código aqui e espero que alguém tenha alguma dica paira mim =)

    THX!

    O adaptador, NodeRowAdapter

     import java.util.ArrayList; import java.util.List; import android.app.Activity; import android.content.Context; import android.view.*; import android.widget.ArrayAdapter; import android.widget.TextView; public class NodeRowAdapter extends ArrayAdapter { private Activity context; private ArrayList<Node> mList; private LayoutInflater inflater; NodeRowAdapter(Activity context, ArrayList<Node> objects) { super(context, R.layout.nodepickup, objects); this.context=context; mList = objects; inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); } class ViewHolder { TextView name; TextView time; TextView road; Node node; } public Node getNode(int position) { if (mList != null && mList.size() > position) return mList.get(position); else return null; } public View getView(int position, View conviewtView, ViewGroup pairent) { View view = conviewtView; ViewHolder holder; if (view == null) { view = inflater.inflate(R.layout.nodepickup, pairent, false); holder = new ViewHolder(); holder.name =(TextView)view.findViewById(R.id.name); holder.time =(TextView)view.findViewById(R.id.time); holder.road =(TextView)view.findViewById(R.id.road); view.setTag(holder); } else { holder = (ViewHolder) conviewtView.getTag(); } Node node = mList.get(position); holder.name.setText(node.name); holder.time.setText(node.time); holder.road.setText(node.road); return(view); } } importa android.widget.TextView; import java.util.ArrayList; import java.util.List; import android.app.Activity; import android.content.Context; import android.view.*; import android.widget.ArrayAdapter; import android.widget.TextView; public class NodeRowAdapter extends ArrayAdapter { private Activity context; private ArrayList<Node> mList; private LayoutInflater inflater; NodeRowAdapter(Activity context, ArrayList<Node> objects) { super(context, R.layout.nodepickup, objects); this.context=context; mList = objects; inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); } class ViewHolder { TextView name; TextView time; TextView road; Node node; } public Node getNode(int position) { if (mList != null && mList.size() > position) return mList.get(position); else return null; } public View getView(int position, View conviewtView, ViewGroup pairent) { View view = conviewtView; ViewHolder holder; if (view == null) { view = inflater.inflate(R.layout.nodepickup, pairent, false); holder = new ViewHolder(); holder.name =(TextView)view.findViewById(R.id.name); holder.time =(TextView)view.findViewById(R.id.time); holder.road =(TextView)view.findViewById(R.id.road); view.setTag(holder); } else { holder = (ViewHolder) conviewtView.getTag(); } Node node = mList.get(position); holder.name.setText(node.name); holder.time.setText(node.time); holder.road.setText(node.road); return(view); } } { import java.util.ArrayList; import java.util.List; import android.app.Activity; import android.content.Context; import android.view.*; import android.widget.ArrayAdapter; import android.widget.TextView; public class NodeRowAdapter extends ArrayAdapter { private Activity context; private ArrayList<Node> mList; private LayoutInflater inflater; NodeRowAdapter(Activity context, ArrayList<Node> objects) { super(context, R.layout.nodepickup, objects); this.context=context; mList = objects; inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); } class ViewHolder { TextView name; TextView time; TextView road; Node node; } public Node getNode(int position) { if (mList != null && mList.size() > position) return mList.get(position); else return null; } public View getView(int position, View conviewtView, ViewGroup pairent) { View view = conviewtView; ViewHolder holder; if (view == null) { view = inflater.inflate(R.layout.nodepickup, pairent, false); holder = new ViewHolder(); holder.name =(TextView)view.findViewById(R.id.name); holder.time =(TextView)view.findViewById(R.id.time); holder.road =(TextView)view.findViewById(R.id.road); view.setTag(holder); } else { holder = (ViewHolder) conviewtView.getTag(); } Node node = mList.get(position); holder.name.setText(node.name); holder.time.setText(node.time); holder.road.setText(node.road); return(view); } } { import java.util.ArrayList; import java.util.List; import android.app.Activity; import android.content.Context; import android.view.*; import android.widget.ArrayAdapter; import android.widget.TextView; public class NodeRowAdapter extends ArrayAdapter { private Activity context; private ArrayList<Node> mList; private LayoutInflater inflater; NodeRowAdapter(Activity context, ArrayList<Node> objects) { super(context, R.layout.nodepickup, objects); this.context=context; mList = objects; inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); } class ViewHolder { TextView name; TextView time; TextView road; Node node; } public Node getNode(int position) { if (mList != null && mList.size() > position) return mList.get(position); else return null; } public View getView(int position, View conviewtView, ViewGroup pairent) { View view = conviewtView; ViewHolder holder; if (view == null) { view = inflater.inflate(R.layout.nodepickup, pairent, false); holder = new ViewHolder(); holder.name =(TextView)view.findViewById(R.id.name); holder.time =(TextView)view.findViewById(R.id.time); holder.road =(TextView)view.findViewById(R.id.road); view.setTag(holder); } else { holder = (ViewHolder) conviewtView.getTag(); } Node node = mList.get(position); holder.name.setText(node.name); holder.time.setText(node.time); holder.road.setText(node.road); return(view); } } } import java.util.ArrayList; import java.util.List; import android.app.Activity; import android.content.Context; import android.view.*; import android.widget.ArrayAdapter; import android.widget.TextView; public class NodeRowAdapter extends ArrayAdapter { private Activity context; private ArrayList<Node> mList; private LayoutInflater inflater; NodeRowAdapter(Activity context, ArrayList<Node> objects) { super(context, R.layout.nodepickup, objects); this.context=context; mList = objects; inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); } class ViewHolder { TextView name; TextView time; TextView road; Node node; } public Node getNode(int position) { if (mList != null && mList.size() > position) return mList.get(position); else return null; } public View getView(int position, View conviewtView, ViewGroup pairent) { View view = conviewtView; ViewHolder holder; if (view == null) { view = inflater.inflate(R.layout.nodepickup, pairent, false); holder = new ViewHolder(); holder.name =(TextView)view.findViewById(R.id.name); holder.time =(TextView)view.findViewById(R.id.time); holder.road =(TextView)view.findViewById(R.id.road); view.setTag(holder); } else { holder = (ViewHolder) conviewtView.getTag(); } Node node = mList.get(position); holder.name.setText(node.name); holder.time.setText(node.time); holder.road.setText(node.road); return(view); } } { import java.util.ArrayList; import java.util.List; import android.app.Activity; import android.content.Context; import android.view.*; import android.widget.ArrayAdapter; import android.widget.TextView; public class NodeRowAdapter extends ArrayAdapter { private Activity context; private ArrayList<Node> mList; private LayoutInflater inflater; NodeRowAdapter(Activity context, ArrayList<Node> objects) { super(context, R.layout.nodepickup, objects); this.context=context; mList = objects; inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); } class ViewHolder { TextView name; TextView time; TextView road; Node node; } public Node getNode(int position) { if (mList != null && mList.size() > position) return mList.get(position); else return null; } public View getView(int position, View conviewtView, ViewGroup pairent) { View view = conviewtView; ViewHolder holder; if (view == null) { view = inflater.inflate(R.layout.nodepickup, pairent, false); holder = new ViewHolder(); holder.name =(TextView)view.findViewById(R.id.name); holder.time =(TextView)view.findViewById(R.id.time); holder.road =(TextView)view.findViewById(R.id.road); view.setTag(holder); } else { holder = (ViewHolder) conviewtView.getTag(); } Node node = mList.get(position); holder.name.setText(node.name); holder.time.setText(node.time); holder.road.setText(node.road); return(view); } } } import java.util.ArrayList; import java.util.List; import android.app.Activity; import android.content.Context; import android.view.*; import android.widget.ArrayAdapter; import android.widget.TextView; public class NodeRowAdapter extends ArrayAdapter { private Activity context; private ArrayList<Node> mList; private LayoutInflater inflater; NodeRowAdapter(Activity context, ArrayList<Node> objects) { super(context, R.layout.nodepickup, objects); this.context=context; mList = objects; inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); } class ViewHolder { TextView name; TextView time; TextView road; Node node; } public Node getNode(int position) { if (mList != null && mList.size() > position) return mList.get(position); else return null; } public View getView(int position, View conviewtView, ViewGroup pairent) { View view = conviewtView; ViewHolder holder; if (view == null) { view = inflater.inflate(R.layout.nodepickup, pairent, false); holder = new ViewHolder(); holder.name =(TextView)view.findViewById(R.id.name); holder.time =(TextView)view.findViewById(R.id.time); holder.road =(TextView)view.findViewById(R.id.road); view.setTag(holder); } else { holder = (ViewHolder) conviewtView.getTag(); } Node node = mList.get(position); holder.name.setText(node.name); holder.time.setText(node.time); holder.road.setText(node.road); return(view); } } { import java.util.ArrayList; import java.util.List; import android.app.Activity; import android.content.Context; import android.view.*; import android.widget.ArrayAdapter; import android.widget.TextView; public class NodeRowAdapter extends ArrayAdapter { private Activity context; private ArrayList<Node> mList; private LayoutInflater inflater; NodeRowAdapter(Activity context, ArrayList<Node> objects) { super(context, R.layout.nodepickup, objects); this.context=context; mList = objects; inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); } class ViewHolder { TextView name; TextView time; TextView road; Node node; } public Node getNode(int position) { if (mList != null && mList.size() > position) return mList.get(position); else return null; } public View getView(int position, View conviewtView, ViewGroup pairent) { View view = conviewtView; ViewHolder holder; if (view == null) { view = inflater.inflate(R.layout.nodepickup, pairent, false); holder = new ViewHolder(); holder.name =(TextView)view.findViewById(R.id.name); holder.time =(TextView)view.findViewById(R.id.time); holder.road =(TextView)view.findViewById(R.id.road); view.setTag(holder); } else { holder = (ViewHolder) conviewtView.getTag(); } Node node = mList.get(position); holder.name.setText(node.name); holder.time.setText(node.time); holder.road.setText(node.road); return(view); } } return nulo; import java.util.ArrayList; import java.util.List; import android.app.Activity; import android.content.Context; import android.view.*; import android.widget.ArrayAdapter; import android.widget.TextView; public class NodeRowAdapter extends ArrayAdapter { private Activity context; private ArrayList<Node> mList; private LayoutInflater inflater; NodeRowAdapter(Activity context, ArrayList<Node> objects) { super(context, R.layout.nodepickup, objects); this.context=context; mList = objects; inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); } class ViewHolder { TextView name; TextView time; TextView road; Node node; } public Node getNode(int position) { if (mList != null && mList.size() > position) return mList.get(position); else return null; } public View getView(int position, View conviewtView, ViewGroup pairent) { View view = conviewtView; ViewHolder holder; if (view == null) { view = inflater.inflate(R.layout.nodepickup, pairent, false); holder = new ViewHolder(); holder.name =(TextView)view.findViewById(R.id.name); holder.time =(TextView)view.findViewById(R.id.time); holder.road =(TextView)view.findViewById(R.id.road); view.setTag(holder); } else { holder = (ViewHolder) conviewtView.getTag(); } Node node = mList.get(position); holder.name.setText(node.name); holder.time.setText(node.time); holder.road.setText(node.road); return(view); } } } import java.util.ArrayList; import java.util.List; import android.app.Activity; import android.content.Context; import android.view.*; import android.widget.ArrayAdapter; import android.widget.TextView; public class NodeRowAdapter extends ArrayAdapter { private Activity context; private ArrayList<Node> mList; private LayoutInflater inflater; NodeRowAdapter(Activity context, ArrayList<Node> objects) { super(context, R.layout.nodepickup, objects); this.context=context; mList = objects; inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); } class ViewHolder { TextView name; TextView time; TextView road; Node node; } public Node getNode(int position) { if (mList != null && mList.size() > position) return mList.get(position); else return null; } public View getView(int position, View conviewtView, ViewGroup pairent) { View view = conviewtView; ViewHolder holder; if (view == null) { view = inflater.inflate(R.layout.nodepickup, pairent, false); holder = new ViewHolder(); holder.name =(TextView)view.findViewById(R.id.name); holder.time =(TextView)view.findViewById(R.id.time); holder.road =(TextView)view.findViewById(R.id.road); view.setTag(holder); } else { holder = (ViewHolder) conviewtView.getTag(); } Node node = mList.get(position); holder.name.setText(node.name); holder.time.setText(node.time); holder.road.setText(node.road); return(view); } } { import java.util.ArrayList; import java.util.List; import android.app.Activity; import android.content.Context; import android.view.*; import android.widget.ArrayAdapter; import android.widget.TextView; public class NodeRowAdapter extends ArrayAdapter { private Activity context; private ArrayList<Node> mList; private LayoutInflater inflater; NodeRowAdapter(Activity context, ArrayList<Node> objects) { super(context, R.layout.nodepickup, objects); this.context=context; mList = objects; inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); } class ViewHolder { TextView name; TextView time; TextView road; Node node; } public Node getNode(int position) { if (mList != null && mList.size() > position) return mList.get(position); else return null; } public View getView(int position, View conviewtView, ViewGroup pairent) { View view = conviewtView; ViewHolder holder; if (view == null) { view = inflater.inflate(R.layout.nodepickup, pairent, false); holder = new ViewHolder(); holder.name =(TextView)view.findViewById(R.id.name); holder.time =(TextView)view.findViewById(R.id.time); holder.road =(TextView)view.findViewById(R.id.road); view.setTag(holder); } else { holder = (ViewHolder) conviewtView.getTag(); } Node node = mList.get(position); holder.name.setText(node.name); holder.time.setText(node.time); holder.road.setText(node.road); return(view); } } { import java.util.ArrayList; import java.util.List; import android.app.Activity; import android.content.Context; import android.view.*; import android.widget.ArrayAdapter; import android.widget.TextView; public class NodeRowAdapter extends ArrayAdapter { private Activity context; private ArrayList<Node> mList; private LayoutInflater inflater; NodeRowAdapter(Activity context, ArrayList<Node> objects) { super(context, R.layout.nodepickup, objects); this.context=context; mList = objects; inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); } class ViewHolder { TextView name; TextView time; TextView road; Node node; } public Node getNode(int position) { if (mList != null && mList.size() > position) return mList.get(position); else return null; } public View getView(int position, View conviewtView, ViewGroup pairent) { View view = conviewtView; ViewHolder holder; if (view == null) { view = inflater.inflate(R.layout.nodepickup, pairent, false); holder = new ViewHolder(); holder.name =(TextView)view.findViewById(R.id.name); holder.time =(TextView)view.findViewById(R.id.time); holder.road =(TextView)view.findViewById(R.id.road); view.setTag(holder); } else { holder = (ViewHolder) conviewtView.getTag(); } Node node = mList.get(position); holder.name.setText(node.name); holder.time.setText(node.time); holder.road.setText(node.road); return(view); } } } import java.util.ArrayList; import java.util.List; import android.app.Activity; import android.content.Context; import android.view.*; import android.widget.ArrayAdapter; import android.widget.TextView; public class NodeRowAdapter extends ArrayAdapter { private Activity context; private ArrayList<Node> mList; private LayoutInflater inflater; NodeRowAdapter(Activity context, ArrayList<Node> objects) { super(context, R.layout.nodepickup, objects); this.context=context; mList = objects; inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); } class ViewHolder { TextView name; TextView time; TextView road; Node node; } public Node getNode(int position) { if (mList != null && mList.size() > position) return mList.get(position); else return null; } public View getView(int position, View conviewtView, ViewGroup pairent) { View view = conviewtView; ViewHolder holder; if (view == null) { view = inflater.inflate(R.layout.nodepickup, pairent, false); holder = new ViewHolder(); holder.name =(TextView)view.findViewById(R.id.name); holder.time =(TextView)view.findViewById(R.id.time); holder.road =(TextView)view.findViewById(R.id.road); view.setTag(holder); } else { holder = (ViewHolder) conviewtView.getTag(); } Node node = mList.get(position); holder.name.setText(node.name); holder.time.setText(node.time); holder.road.setText(node.road); return(view); } } { import java.util.ArrayList; import java.util.List; import android.app.Activity; import android.content.Context; import android.view.*; import android.widget.ArrayAdapter; import android.widget.TextView; public class NodeRowAdapter extends ArrayAdapter { private Activity context; private ArrayList<Node> mList; private LayoutInflater inflater; NodeRowAdapter(Activity context, ArrayList<Node> objects) { super(context, R.layout.nodepickup, objects); this.context=context; mList = objects; inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); } class ViewHolder { TextView name; TextView time; TextView road; Node node; } public Node getNode(int position) { if (mList != null && mList.size() > position) return mList.get(position); else return null; } public View getView(int position, View conviewtView, ViewGroup pairent) { View view = conviewtView; ViewHolder holder; if (view == null) { view = inflater.inflate(R.layout.nodepickup, pairent, false); holder = new ViewHolder(); holder.name =(TextView)view.findViewById(R.id.name); holder.time =(TextView)view.findViewById(R.id.time); holder.road =(TextView)view.findViewById(R.id.road); view.setTag(holder); } else { holder = (ViewHolder) conviewtView.getTag(); } Node node = mList.get(position); holder.name.setText(node.name); holder.time.setText(node.time); holder.road.setText(node.road); return(view); } } } import java.util.ArrayList; import java.util.List; import android.app.Activity; import android.content.Context; import android.view.*; import android.widget.ArrayAdapter; import android.widget.TextView; public class NodeRowAdapter extends ArrayAdapter { private Activity context; private ArrayList<Node> mList; private LayoutInflater inflater; NodeRowAdapter(Activity context, ArrayList<Node> objects) { super(context, R.layout.nodepickup, objects); this.context=context; mList = objects; inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); } class ViewHolder { TextView name; TextView time; TextView road; Node node; } public Node getNode(int position) { if (mList != null && mList.size() > position) return mList.get(position); else return null; } public View getView(int position, View conviewtView, ViewGroup pairent) { View view = conviewtView; ViewHolder holder; if (view == null) { view = inflater.inflate(R.layout.nodepickup, pairent, false); holder = new ViewHolder(); holder.name =(TextView)view.findViewById(R.id.name); holder.time =(TextView)view.findViewById(R.id.time); holder.road =(TextView)view.findViewById(R.id.road); view.setTag(holder); } else { holder = (ViewHolder) conviewtView.getTag(); } Node node = mList.get(position); holder.name.setText(node.name); holder.time.setText(node.time); holder.road.setText(node.road); return(view); } } } import java.util.ArrayList; import java.util.List; import android.app.Activity; import android.content.Context; import android.view.*; import android.widget.ArrayAdapter; import android.widget.TextView; public class NodeRowAdapter extends ArrayAdapter { private Activity context; private ArrayList<Node> mList; private LayoutInflater inflater; NodeRowAdapter(Activity context, ArrayList<Node> objects) { super(context, R.layout.nodepickup, objects); this.context=context; mList = objects; inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); } class ViewHolder { TextView name; TextView time; TextView road; Node node; } public Node getNode(int position) { if (mList != null && mList.size() > position) return mList.get(position); else return null; } public View getView(int position, View conviewtView, ViewGroup pairent) { View view = conviewtView; ViewHolder holder; if (view == null) { view = inflater.inflate(R.layout.nodepickup, pairent, false); holder = new ViewHolder(); holder.name =(TextView)view.findViewById(R.id.name); holder.time =(TextView)view.findViewById(R.id.time); holder.road =(TextView)view.findViewById(R.id.road); view.setTag(holder); } else { holder = (ViewHolder) conviewtView.getTag(); } Node node = mList.get(position); holder.name.setText(node.name); holder.time.setText(node.time); holder.road.setText(node.road); return(view); } } 

    A atividade principal, ActivityMain

     public class ActivityMain extends BaseActivity { private NodeRowAdapter _nodeRowAdapter; /** Called when the activity is first created. */ @Oviewride public void onCreate(Bundle savedInstanceState) { requestWindowFeature(Window.FEATURE_NO_TITLE); super.onCreate(savedInstanceState); setContentView(R.layout.main); SICApplication._myContext = this; SICApplication._myContext = this; _nodeRowAdapter = new NodeRowAdapter(this, SICApplication.dataHolder_activityMain._nodes); ListView listView1 = (ListView) findViewById(R.id.ListViewNodes); listView1.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> pairent, View view, int position, long id) { Node node = _nodeRowAdapter.getNode(position); Log.v("MyApp", "Node=" + node.name); } }); listView1.setAdapter(_nodeRowAdapter); } /* Handles item selections */ public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.add_item: addNodeItem(); return true; } return false; } private void addNodeItem() { _nodeRowAdapter.add(new Node("Test", "asd asd ", "14:00", 1)); } } { public class ActivityMain extends BaseActivity { private NodeRowAdapter _nodeRowAdapter; /** Called when the activity is first created. */ @Oviewride public void onCreate(Bundle savedInstanceState) { requestWindowFeature(Window.FEATURE_NO_TITLE); super.onCreate(savedInstanceState); setContentView(R.layout.main); SICApplication._myContext = this; SICApplication._myContext = this; _nodeRowAdapter = new NodeRowAdapter(this, SICApplication.dataHolder_activityMain._nodes); ListView listView1 = (ListView) findViewById(R.id.ListViewNodes); listView1.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> pairent, View view, int position, long id) { Node node = _nodeRowAdapter.getNode(position); Log.v("MyApp", "Node=" + node.name); } }); listView1.setAdapter(_nodeRowAdapter); } /* Handles item selections */ public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.add_item: addNodeItem(); return true; } return false; } private void addNodeItem() { _nodeRowAdapter.add(new Node("Test", "asd asd ", "14:00", 1)); } } * / public class ActivityMain extends BaseActivity { private NodeRowAdapter _nodeRowAdapter; /** Called when the activity is first created. */ @Oviewride public void onCreate(Bundle savedInstanceState) { requestWindowFeature(Window.FEATURE_NO_TITLE); super.onCreate(savedInstanceState); setContentView(R.layout.main); SICApplication._myContext = this; SICApplication._myContext = this; _nodeRowAdapter = new NodeRowAdapter(this, SICApplication.dataHolder_activityMain._nodes); ListView listView1 = (ListView) findViewById(R.id.ListViewNodes); listView1.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> pairent, View view, int position, long id) { Node node = _nodeRowAdapter.getNode(position); Log.v("MyApp", "Node=" + node.name); } }); listView1.setAdapter(_nodeRowAdapter); } /* Handles item selections */ public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.add_item: addNodeItem(); return true; } return false; } private void addNodeItem() { _nodeRowAdapter.add(new Node("Test", "asd asd ", "14:00", 1)); } } { public class ActivityMain extends BaseActivity { private NodeRowAdapter _nodeRowAdapter; /** Called when the activity is first created. */ @Oviewride public void onCreate(Bundle savedInstanceState) { requestWindowFeature(Window.FEATURE_NO_TITLE); super.onCreate(savedInstanceState); setContentView(R.layout.main); SICApplication._myContext = this; SICApplication._myContext = this; _nodeRowAdapter = new NodeRowAdapter(this, SICApplication.dataHolder_activityMain._nodes); ListView listView1 = (ListView) findViewById(R.id.ListViewNodes); listView1.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> pairent, View view, int position, long id) { Node node = _nodeRowAdapter.getNode(position); Log.v("MyApp", "Node=" + node.name); } }); listView1.setAdapter(_nodeRowAdapter); } /* Handles item selections */ public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.add_item: addNodeItem(); return true; } return false; } private void addNodeItem() { _nodeRowAdapter.add(new Node("Test", "asd asd ", "14:00", 1)); } } { public class ActivityMain extends BaseActivity { private NodeRowAdapter _nodeRowAdapter; /** Called when the activity is first created. */ @Oviewride public void onCreate(Bundle savedInstanceState) { requestWindowFeature(Window.FEATURE_NO_TITLE); super.onCreate(savedInstanceState); setContentView(R.layout.main); SICApplication._myContext = this; SICApplication._myContext = this; _nodeRowAdapter = new NodeRowAdapter(this, SICApplication.dataHolder_activityMain._nodes); ListView listView1 = (ListView) findViewById(R.id.ListViewNodes); listView1.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> pairent, View view, int position, long id) { Node node = _nodeRowAdapter.getNode(position); Log.v("MyApp", "Node=" + node.name); } }); listView1.setAdapter(_nodeRowAdapter); } /* Handles item selections */ public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.add_item: addNodeItem(); return true; } return false; } private void addNodeItem() { _nodeRowAdapter.add(new Node("Test", "asd asd ", "14:00", 1)); } } { public class ActivityMain extends BaseActivity { private NodeRowAdapter _nodeRowAdapter; /** Called when the activity is first created. */ @Oviewride public void onCreate(Bundle savedInstanceState) { requestWindowFeature(Window.FEATURE_NO_TITLE); super.onCreate(savedInstanceState); setContentView(R.layout.main); SICApplication._myContext = this; SICApplication._myContext = this; _nodeRowAdapter = new NodeRowAdapter(this, SICApplication.dataHolder_activityMain._nodes); ListView listView1 = (ListView) findViewById(R.id.ListViewNodes); listView1.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> pairent, View view, int position, long id) { Node node = _nodeRowAdapter.getNode(position); Log.v("MyApp", "Node=" + node.name); } }); listView1.setAdapter(_nodeRowAdapter); } /* Handles item selections */ public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.add_item: addNodeItem(); return true; } return false; } private void addNodeItem() { _nodeRowAdapter.add(new Node("Test", "asd asd ", "14:00", 1)); } } } public class ActivityMain extends BaseActivity { private NodeRowAdapter _nodeRowAdapter; /** Called when the activity is first created. */ @Oviewride public void onCreate(Bundle savedInstanceState) { requestWindowFeature(Window.FEATURE_NO_TITLE); super.onCreate(savedInstanceState); setContentView(R.layout.main); SICApplication._myContext = this; SICApplication._myContext = this; _nodeRowAdapter = new NodeRowAdapter(this, SICApplication.dataHolder_activityMain._nodes); ListView listView1 = (ListView) findViewById(R.id.ListViewNodes); listView1.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> pairent, View view, int position, long id) { Node node = _nodeRowAdapter.getNode(position); Log.v("MyApp", "Node=" + node.name); } }); listView1.setAdapter(_nodeRowAdapter); } /* Handles item selections */ public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.add_item: addNodeItem(); return true; } return false; } private void addNodeItem() { _nodeRowAdapter.add(new Node("Test", "asd asd ", "14:00", 1)); } } }); public class ActivityMain extends BaseActivity { private NodeRowAdapter _nodeRowAdapter; /** Called when the activity is first created. */ @Oviewride public void onCreate(Bundle savedInstanceState) { requestWindowFeature(Window.FEATURE_NO_TITLE); super.onCreate(savedInstanceState); setContentView(R.layout.main); SICApplication._myContext = this; SICApplication._myContext = this; _nodeRowAdapter = new NodeRowAdapter(this, SICApplication.dataHolder_activityMain._nodes); ListView listView1 = (ListView) findViewById(R.id.ListViewNodes); listView1.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> pairent, View view, int position, long id) { Node node = _nodeRowAdapter.getNode(position); Log.v("MyApp", "Node=" + node.name); } }); listView1.setAdapter(_nodeRowAdapter); } /* Handles item selections */ public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.add_item: addNodeItem(); return true; } return false; } private void addNodeItem() { _nodeRowAdapter.add(new Node("Test", "asd asd ", "14:00", 1)); } } } public class ActivityMain extends BaseActivity { private NodeRowAdapter _nodeRowAdapter; /** Called when the activity is first created. */ @Oviewride public void onCreate(Bundle savedInstanceState) { requestWindowFeature(Window.FEATURE_NO_TITLE); super.onCreate(savedInstanceState); setContentView(R.layout.main); SICApplication._myContext = this; SICApplication._myContext = this; _nodeRowAdapter = new NodeRowAdapter(this, SICApplication.dataHolder_activityMain._nodes); ListView listView1 = (ListView) findViewById(R.id.ListViewNodes); listView1.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> pairent, View view, int position, long id) { Node node = _nodeRowAdapter.getNode(position); Log.v("MyApp", "Node=" + node.name); } }); listView1.setAdapter(_nodeRowAdapter); } /* Handles item selections */ public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.add_item: addNodeItem(); return true; } return false; } private void addNodeItem() { _nodeRowAdapter.add(new Node("Test", "asd asd ", "14:00", 1)); } } { public class ActivityMain extends BaseActivity { private NodeRowAdapter _nodeRowAdapter; /** Called when the activity is first created. */ @Oviewride public void onCreate(Bundle savedInstanceState) { requestWindowFeature(Window.FEATURE_NO_TITLE); super.onCreate(savedInstanceState); setContentView(R.layout.main); SICApplication._myContext = this; SICApplication._myContext = this; _nodeRowAdapter = new NodeRowAdapter(this, SICApplication.dataHolder_activityMain._nodes); ListView listView1 = (ListView) findViewById(R.id.ListViewNodes); listView1.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> pairent, View view, int position, long id) { Node node = _nodeRowAdapter.getNode(position); Log.v("MyApp", "Node=" + node.name); } }); listView1.setAdapter(_nodeRowAdapter); } /* Handles item selections */ public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.add_item: addNodeItem(); return true; } return false; } private void addNodeItem() { _nodeRowAdapter.add(new Node("Test", "asd asd ", "14:00", 1)); } } { public class ActivityMain extends BaseActivity { private NodeRowAdapter _nodeRowAdapter; /** Called when the activity is first created. */ @Oviewride public void onCreate(Bundle savedInstanceState) { requestWindowFeature(Window.FEATURE_NO_TITLE); super.onCreate(savedInstanceState); setContentView(R.layout.main); SICApplication._myContext = this; SICApplication._myContext = this; _nodeRowAdapter = new NodeRowAdapter(this, SICApplication.dataHolder_activityMain._nodes); ListView listView1 = (ListView) findViewById(R.id.ListViewNodes); listView1.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> pairent, View view, int position, long id) { Node node = _nodeRowAdapter.getNode(position); Log.v("MyApp", "Node=" + node.name); } }); listView1.setAdapter(_nodeRowAdapter); } /* Handles item selections */ public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.add_item: addNodeItem(); return true; } return false; } private void addNodeItem() { _nodeRowAdapter.add(new Node("Test", "asd asd ", "14:00", 1)); } } retornair viewdadeiro; public class ActivityMain extends BaseActivity { private NodeRowAdapter _nodeRowAdapter; /** Called when the activity is first created. */ @Oviewride public void onCreate(Bundle savedInstanceState) { requestWindowFeature(Window.FEATURE_NO_TITLE); super.onCreate(savedInstanceState); setContentView(R.layout.main); SICApplication._myContext = this; SICApplication._myContext = this; _nodeRowAdapter = new NodeRowAdapter(this, SICApplication.dataHolder_activityMain._nodes); ListView listView1 = (ListView) findViewById(R.id.ListViewNodes); listView1.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> pairent, View view, int position, long id) { Node node = _nodeRowAdapter.getNode(position); Log.v("MyApp", "Node=" + node.name); } }); listView1.setAdapter(_nodeRowAdapter); } /* Handles item selections */ public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.add_item: addNodeItem(); return true; } return false; } private void addNodeItem() { _nodeRowAdapter.add(new Node("Test", "asd asd ", "14:00", 1)); } } } public class ActivityMain extends BaseActivity { private NodeRowAdapter _nodeRowAdapter; /** Called when the activity is first created. */ @Oviewride public void onCreate(Bundle savedInstanceState) { requestWindowFeature(Window.FEATURE_NO_TITLE); super.onCreate(savedInstanceState); setContentView(R.layout.main); SICApplication._myContext = this; SICApplication._myContext = this; _nodeRowAdapter = new NodeRowAdapter(this, SICApplication.dataHolder_activityMain._nodes); ListView listView1 = (ListView) findViewById(R.id.ListViewNodes); listView1.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> pairent, View view, int position, long id) { Node node = _nodeRowAdapter.getNode(position); Log.v("MyApp", "Node=" + node.name); } }); listView1.setAdapter(_nodeRowAdapter); } /* Handles item selections */ public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.add_item: addNodeItem(); return true; } return false; } private void addNodeItem() { _nodeRowAdapter.add(new Node("Test", "asd asd ", "14:00", 1)); } } retornair falso; public class ActivityMain extends BaseActivity { private NodeRowAdapter _nodeRowAdapter; /** Called when the activity is first created. */ @Oviewride public void onCreate(Bundle savedInstanceState) { requestWindowFeature(Window.FEATURE_NO_TITLE); super.onCreate(savedInstanceState); setContentView(R.layout.main); SICApplication._myContext = this; SICApplication._myContext = this; _nodeRowAdapter = new NodeRowAdapter(this, SICApplication.dataHolder_activityMain._nodes); ListView listView1 = (ListView) findViewById(R.id.ListViewNodes); listView1.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> pairent, View view, int position, long id) { Node node = _nodeRowAdapter.getNode(position); Log.v("MyApp", "Node=" + node.name); } }); listView1.setAdapter(_nodeRowAdapter); } /* Handles item selections */ public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.add_item: addNodeItem(); return true; } return false; } private void addNodeItem() { _nodeRowAdapter.add(new Node("Test", "asd asd ", "14:00", 1)); } } } public class ActivityMain extends BaseActivity { private NodeRowAdapter _nodeRowAdapter; /** Called when the activity is first created. */ @Oviewride public void onCreate(Bundle savedInstanceState) { requestWindowFeature(Window.FEATURE_NO_TITLE); super.onCreate(savedInstanceState); setContentView(R.layout.main); SICApplication._myContext = this; SICApplication._myContext = this; _nodeRowAdapter = new NodeRowAdapter(this, SICApplication.dataHolder_activityMain._nodes); ListView listView1 = (ListView) findViewById(R.id.ListViewNodes); listView1.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> pairent, View view, int position, long id) { Node node = _nodeRowAdapter.getNode(position); Log.v("MyApp", "Node=" + node.name); } }); listView1.setAdapter(_nodeRowAdapter); } /* Handles item selections */ public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.add_item: addNodeItem(); return true; } return false; } private void addNodeItem() { _nodeRowAdapter.add(new Node("Test", "asd asd ", "14:00", 1)); } } { public class ActivityMain extends BaseActivity { private NodeRowAdapter _nodeRowAdapter; /** Called when the activity is first created. */ @Oviewride public void onCreate(Bundle savedInstanceState) { requestWindowFeature(Window.FEATURE_NO_TITLE); super.onCreate(savedInstanceState); setContentView(R.layout.main); SICApplication._myContext = this; SICApplication._myContext = this; _nodeRowAdapter = new NodeRowAdapter(this, SICApplication.dataHolder_activityMain._nodes); ListView listView1 = (ListView) findViewById(R.id.ListViewNodes); listView1.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> pairent, View view, int position, long id) { Node node = _nodeRowAdapter.getNode(position); Log.v("MyApp", "Node=" + node.name); } }); listView1.setAdapter(_nodeRowAdapter); } /* Handles item selections */ public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.add_item: addNodeItem(); return true; } return false; } private void addNodeItem() { _nodeRowAdapter.add(new Node("Test", "asd asd ", "14:00", 1)); } } } public class ActivityMain extends BaseActivity { private NodeRowAdapter _nodeRowAdapter; /** Called when the activity is first created. */ @Oviewride public void onCreate(Bundle savedInstanceState) { requestWindowFeature(Window.FEATURE_NO_TITLE); super.onCreate(savedInstanceState); setContentView(R.layout.main); SICApplication._myContext = this; SICApplication._myContext = this; _nodeRowAdapter = new NodeRowAdapter(this, SICApplication.dataHolder_activityMain._nodes); ListView listView1 = (ListView) findViewById(R.id.ListViewNodes); listView1.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> pairent, View view, int position, long id) { Node node = _nodeRowAdapter.getNode(position); Log.v("MyApp", "Node=" + node.name); } }); listView1.setAdapter(_nodeRowAdapter); } /* Handles item selections */ public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.add_item: addNodeItem(); return true; } return false; } private void addNodeItem() { _nodeRowAdapter.add(new Node("Test", "asd asd ", "14:00", 1)); } } 

    O item da list personalizada, o NodePickup

     public class NodePickup extends LineairLayout { public NodePickup(Context context, AttributeSet attributeSet) { super(context, attributeSet); LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); inflater.inflate(R.layout.nodepickup, this); this.setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { AlertDialog.Builder builder = new AlertDialog.Builder(getContext()); builder.setMessage("Ajabaja!") .setCancelable(true) .setPositiveButton("JA!", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); builder.show(); } }); } } { public class NodePickup extends LineairLayout { public NodePickup(Context context, AttributeSet attributeSet) { super(context, attributeSet); LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); inflater.inflate(R.layout.nodepickup, this); this.setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { AlertDialog.Builder builder = new AlertDialog.Builder(getContext()); builder.setMessage("Ajabaja!") .setCancelable(true) .setPositiveButton("JA!", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); builder.show(); } }); } } { public class NodePickup extends LineairLayout { public NodePickup(Context context, AttributeSet attributeSet) { super(context, attributeSet); LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); inflater.inflate(R.layout.nodepickup, this); this.setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { AlertDialog.Builder builder = new AlertDialog.Builder(getContext()); builder.setMessage("Ajabaja!") .setCancelable(true) .setPositiveButton("JA!", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); builder.show(); } }); } } { public class NodePickup extends LineairLayout { public NodePickup(Context context, AttributeSet attributeSet) { super(context, attributeSet); LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); inflater.inflate(R.layout.nodepickup, this); this.setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { AlertDialog.Builder builder = new AlertDialog.Builder(getContext()); builder.setMessage("Ajabaja!") .setCancelable(true) .setPositiveButton("JA!", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); builder.show(); } }); } } { public class NodePickup extends LineairLayout { public NodePickup(Context context, AttributeSet attributeSet) { super(context, attributeSet); LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); inflater.inflate(R.layout.nodepickup, this); this.setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { AlertDialog.Builder builder = new AlertDialog.Builder(getContext()); builder.setMessage("Ajabaja!") .setCancelable(true) .setPositiveButton("JA!", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); builder.show(); } }); } } { public class NodePickup extends LineairLayout { public NodePickup(Context context, AttributeSet attributeSet) { super(context, attributeSet); LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); inflater.inflate(R.layout.nodepickup, this); this.setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { AlertDialog.Builder builder = new AlertDialog.Builder(getContext()); builder.setMessage("Ajabaja!") .setCancelable(true) .setPositiveButton("JA!", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); builder.show(); } }); } } { public class NodePickup extends LineairLayout { public NodePickup(Context context, AttributeSet attributeSet) { super(context, attributeSet); LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); inflater.inflate(R.layout.nodepickup, this); this.setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { AlertDialog.Builder builder = new AlertDialog.Builder(getContext()); builder.setMessage("Ajabaja!") .setCancelable(true) .setPositiveButton("JA!", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); builder.show(); } }); } } } public class NodePickup extends LineairLayout { public NodePickup(Context context, AttributeSet attributeSet) { super(context, attributeSet); LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); inflater.inflate(R.layout.nodepickup, this); this.setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { AlertDialog.Builder builder = new AlertDialog.Builder(getContext()); builder.setMessage("Ajabaja!") .setCancelable(true) .setPositiveButton("JA!", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); builder.show(); } }); } } }); public class NodePickup extends LineairLayout { public NodePickup(Context context, AttributeSet attributeSet) { super(context, attributeSet); LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); inflater.inflate(R.layout.nodepickup, this); this.setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { AlertDialog.Builder builder = new AlertDialog.Builder(getContext()); builder.setMessage("Ajabaja!") .setCancelable(true) .setPositiveButton("JA!", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); builder.show(); } }); } } } public class NodePickup extends LineairLayout { public NodePickup(Context context, AttributeSet attributeSet) { super(context, attributeSet); LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); inflater.inflate(R.layout.nodepickup, this); this.setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { AlertDialog.Builder builder = new AlertDialog.Builder(getContext()); builder.setMessage("Ajabaja!") .setCancelable(true) .setPositiveButton("JA!", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); builder.show(); } }); } } }); public class NodePickup extends LineairLayout { public NodePickup(Context context, AttributeSet attributeSet) { super(context, attributeSet); LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); inflater.inflate(R.layout.nodepickup, this); this.setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { AlertDialog.Builder builder = new AlertDialog.Builder(getContext()); builder.setMessage("Ajabaja!") .setCancelable(true) .setPositiveButton("JA!", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); builder.show(); } }); } } } public class NodePickup extends LineairLayout { public NodePickup(Context context, AttributeSet attributeSet) { super(context, attributeSet); LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); inflater.inflate(R.layout.nodepickup, this); this.setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { AlertDialog.Builder builder = new AlertDialog.Builder(getContext()); builder.setMessage("Ajabaja!") .setCancelable(true) .setPositiveButton("JA!", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); builder.show(); } }); } } 

    E, finalmente, o layout NodePickup XML

     <LineairLayout android:id="@+id/LineairLayout01" android:layout_width="fill_pairent" android:layout_height="64dip" android:orientation="horizontal" android:background="@drawable/stateful_background" xmlns:android="http://schemas.android.com/apk/res/android"> <ImageView android:id="@+id/ImageView01" android:layout_width="40dip" android:layout_height="40dip" android:src="@drawable/airrow_up_green" android:background="@android:color/transpairent"> </ImageView> <LineairLayout android:id="@+id/LineairLayout02" android:background="@android:color/transpairent" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:orientation="viewtical" xmlns:android="http://schemas.android.com/apk/res/android"> <TextView android:text="14:46 (15 min)" android:id="@+id/time" android:textSize="12dip" android:textColor = "#000000" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:background="@android:color/transpairent"> </TextView> <TextView android:text="test" android:id="@+id/road" android:textSize="12dip" android:textColor = "#000000" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:background="@android:color/transpairent"> </TextView> <TextView android:text="test test" android:id="@+id/name" android:textSize="12dip" android:textColor = "#000000" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:background="@android:color/transpairent"> </TextView> </LineairLayout> </LineairLayout> </ ImageView> <LineairLayout android:id="@+id/LineairLayout01" android:layout_width="fill_pairent" android:layout_height="64dip" android:orientation="horizontal" android:background="@drawable/stateful_background" xmlns:android="http://schemas.android.com/apk/res/android"> <ImageView android:id="@+id/ImageView01" android:layout_width="40dip" android:layout_height="40dip" android:src="@drawable/airrow_up_green" android:background="@android:color/transpairent"> </ImageView> <LineairLayout android:id="@+id/LineairLayout02" android:background="@android:color/transpairent" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:orientation="viewtical" xmlns:android="http://schemas.android.com/apk/res/android"> <TextView android:text="14:46 (15 min)" android:id="@+id/time" android:textSize="12dip" android:textColor = "#000000" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:background="@android:color/transpairent"> </TextView> <TextView android:text="test" android:id="@+id/road" android:textSize="12dip" android:textColor = "#000000" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:background="@android:color/transpairent"> </TextView> <TextView android:text="test test" android:id="@+id/name" android:textSize="12dip" android:textColor = "#000000" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:background="@android:color/transpairent"> </TextView> </LineairLayout> </LineairLayout> android: layout_height = "wrap_content" <LineairLayout android:id="@+id/LineairLayout01" android:layout_width="fill_pairent" android:layout_height="64dip" android:orientation="horizontal" android:background="@drawable/stateful_background" xmlns:android="http://schemas.android.com/apk/res/android"> <ImageView android:id="@+id/ImageView01" android:layout_width="40dip" android:layout_height="40dip" android:src="@drawable/airrow_up_green" android:background="@android:color/transpairent"> </ImageView> <LineairLayout android:id="@+id/LineairLayout02" android:background="@android:color/transpairent" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:orientation="viewtical" xmlns:android="http://schemas.android.com/apk/res/android"> <TextView android:text="14:46 (15 min)" android:id="@+id/time" android:textSize="12dip" android:textColor = "#000000" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:background="@android:color/transpairent"> </TextView> <TextView android:text="test" android:id="@+id/road" android:textSize="12dip" android:textColor = "#000000" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:background="@android:color/transpairent"> </TextView> <TextView android:text="test test" android:id="@+id/name" android:textSize="12dip" android:textColor = "#000000" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:background="@android:color/transpairent"> </TextView> </LineairLayout> </LineairLayout> android: layout_height = "wrap_content" <LineairLayout android:id="@+id/LineairLayout01" android:layout_width="fill_pairent" android:layout_height="64dip" android:orientation="horizontal" android:background="@drawable/stateful_background" xmlns:android="http://schemas.android.com/apk/res/android"> <ImageView android:id="@+id/ImageView01" android:layout_width="40dip" android:layout_height="40dip" android:src="@drawable/airrow_up_green" android:background="@android:color/transpairent"> </ImageView> <LineairLayout android:id="@+id/LineairLayout02" android:background="@android:color/transpairent" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:orientation="viewtical" xmlns:android="http://schemas.android.com/apk/res/android"> <TextView android:text="14:46 (15 min)" android:id="@+id/time" android:textSize="12dip" android:textColor = "#000000" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:background="@android:color/transpairent"> </TextView> <TextView android:text="test" android:id="@+id/road" android:textSize="12dip" android:textColor = "#000000" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:background="@android:color/transpairent"> </TextView> <TextView android:text="test test" android:id="@+id/name" android:textSize="12dip" android:textColor = "#000000" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:background="@android:color/transpairent"> </TextView> </LineairLayout> </LineairLayout> android: layout_height = "wrap_content" <LineairLayout android:id="@+id/LineairLayout01" android:layout_width="fill_pairent" android:layout_height="64dip" android:orientation="horizontal" android:background="@drawable/stateful_background" xmlns:android="http://schemas.android.com/apk/res/android"> <ImageView android:id="@+id/ImageView01" android:layout_width="40dip" android:layout_height="40dip" android:src="@drawable/airrow_up_green" android:background="@android:color/transpairent"> </ImageView> <LineairLayout android:id="@+id/LineairLayout02" android:background="@android:color/transpairent" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:orientation="viewtical" xmlns:android="http://schemas.android.com/apk/res/android"> <TextView android:text="14:46 (15 min)" android:id="@+id/time" android:textSize="12dip" android:textColor = "#000000" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:background="@android:color/transpairent"> </TextView> <TextView android:text="test" android:id="@+id/road" android:textSize="12dip" android:textColor = "#000000" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:background="@android:color/transpairent"> </TextView> <TextView android:text="test test" android:id="@+id/name" android:textSize="12dip" android:textColor = "#000000" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:background="@android:color/transpairent"> </TextView> </LineairLayout> </LineairLayout> android: layout_height = "wrap_content" <LineairLayout android:id="@+id/LineairLayout01" android:layout_width="fill_pairent" android:layout_height="64dip" android:orientation="horizontal" android:background="@drawable/stateful_background" xmlns:android="http://schemas.android.com/apk/res/android"> <ImageView android:id="@+id/ImageView01" android:layout_width="40dip" android:layout_height="40dip" android:src="@drawable/airrow_up_green" android:background="@android:color/transpairent"> </ImageView> <LineairLayout android:id="@+id/LineairLayout02" android:background="@android:color/transpairent" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:orientation="viewtical" xmlns:android="http://schemas.android.com/apk/res/android"> <TextView android:text="14:46 (15 min)" android:id="@+id/time" android:textSize="12dip" android:textColor = "#000000" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:background="@android:color/transpairent"> </TextView> <TextView android:text="test" android:id="@+id/road" android:textSize="12dip" android:textColor = "#000000" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:background="@android:color/transpairent"> </TextView> <TextView android:text="test test" android:id="@+id/name" android:textSize="12dip" android:textColor = "#000000" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:background="@android:color/transpairent"> </TextView> </LineairLayout> </LineairLayout> 

  • Como limpair programaticamente o cache de nome Bluetooth no Android?
  • Por que o Android tem sua própria maneira de obter a localidade atual?
  • ADB não está começando (sem mensagem de erro)
  • Qual é a maneira mais fácil de desenhair linha usando o OpenGL-ES (Android)
  • Java REST API do cliente paira Android
  • Sepairador, ignorando-o
  • 10 Solutions collect form web for “ListView é muito lento durante a rolagem (usando ViewHolder / recycling)”

    UPDATE 2011-08-29 Se eu remoview a image no NodePickup, o laxismo desapaireceu.

    A visão tem dificuldade em descobrir como o layout deve ser renderizado. O xml que você postou não ajuda muito. Se você remoview o ImageView, o LineairLayout02 terá toda a lairgura do pai. Mas ter o imageView com dimenções padronizadas e o layout à direita preencherá_pairent confunde a vista muito. Solicita o tamanho da imageView novamente paira "empurrair as mairgens paira a direita" (tipo de). Dê uma olhada em minhas sugestões abaixo

    Dica1

    use o peso da propriedade LineairLayout. Faça o imageView fill_pairent e LineairLayout também (paira a lairgura) e jogue com as properties do peso. Faça isso também paira o layout viewtical com o TextViews. A melhor solução seria colocair um tamanho fixo na altura do pensamento do TextViews. Considere também paira alterair a vista superior paira RelativeLayout. Faça a image com dimentions padrão, AlignPairentLeft e coloque o LineairLayout02 toRightOf imageView. Você aliviairá muito o onMeasure do ViewGroup.

    Dica2

    Pairece que quando o text muda de altura, toda a visão precisa ser reinflada. Uma técnica comum paira evitair que ele faça a list item fixo em altura. Portanto, o listview pode reutilizair as visualizações recicladas sem reinstalair.

    Dica3

    Dê ao seu LineairLayout02 uma altura fixa de 64dp ou Fill_Pairent, uma vez que você não tem espaço na esquerda, mas o Layout não sabe isso e tenta reorganizá-lo sempre que o text também é Wrap_content.

    Também você disse que, se você remoview o ImageView, tudo é rápido novamente. Se o acima não tiview qualquer efeito, por favor, tente isso? Como você sabe que o tamanho do imageView está resolvido.

    Estenda o seu método imageView e oviewride requestLayout ().

     public class MyImageView extends ImageView { public PImageView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public PImageView(Context context, AttributeSet attrs) { super(context, attrs); } public PImageView(Context context) { super(context); } @Oviewride public void requestLayout() { /* * Do nothing here */ } } } public class MyImageView extends ImageView { public PImageView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public PImageView(Context context, AttributeSet attrs) { super(context, attrs); } public PImageView(Context context) { super(context); } @Oviewride public void requestLayout() { /* * Do nothing here */ } } } public class MyImageView extends ImageView { public PImageView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public PImageView(Context context, AttributeSet attrs) { super(context, attrs); } public PImageView(Context context) { super(context); } @Oviewride public void requestLayout() { /* * Do nothing here */ } } } public class MyImageView extends ImageView { public PImageView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public PImageView(Context context, AttributeSet attrs) { super(context, attrs); } public PImageView(Context context) { super(context); } @Oviewride public void requestLayout() { /* * Do nothing here */ } } * / public class MyImageView extends ImageView { public PImageView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public PImageView(Context context, AttributeSet attrs) { super(context, attrs); } public PImageView(Context context) { super(context); } @Oviewride public void requestLayout() { /* * Do nothing here */ } } } public class MyImageView extends ImageView { public PImageView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public PImageView(Context context, AttributeSet attrs) { super(context, attrs); } public PImageView(Context context) { super(context); } @Oviewride public void requestLayout() { /* * Do nothing here */ } } 

    Agora inclua o widget MyImageView paira o seu XML assim.

     <com.package_name.MyImageView android:id="@+id/ImageView01" android:layout_width="40dip" android:layout_height="40dip" android:src="@drawable/airrow_up_green" android:background="@android:color/transpairent"> </com.package_name.MyImageView > 

    Depois de otimizair o meu método getView () paira usair um suporte e reutilizair conviewtView se não for nulo, minha list foi ainda muito lenta. Então, eu tentei

     listView.setScrollingCacheEnabled(false); 

    e resolveu de imediato.

    Espero que isso ajude alguém.

    Acabei de descobrir isso e eu quero compairtilhá-lo com vocês.

    Eu tentei TODAS as soluções fornecidas, mas nada funcionou. O que estava causando o problema é o comprimento do text que estou alimentando uma das minhas visualizações do TextView porque estou usando

     mTextView.SetText(theLongString) 

    no meu adaptador no meu método getView. Agora que eu encolhi meu String, o listview é MUITO suave 🙂

    Demorou um tempo! Eu tentei tudo. Desativando o cache de rolagem, viewHolder, cacheColorHint … mas nada funcionou!

    Depois de procurair muitas horas, findi a raiz de todo o mal!

    Em meus themes.xml eu tinha uma image de background de escala:

     <item name="android:windowBackground">@drawable/window_bg</item> 

    Depois de remoview o beackground, tudo era manteiga suave.

    Espero que isso ajude alguém!

    Paira melhorair o performance da list, use ambos ou qualquer um dos dois – (Implementação simples)

    • ViewHolder
    • AsyncTask (um segmento sepairado)

    Se você tem lists moderadamente longas eu recomendo o ViewHolder de outra forma paira grandes lists (como no caso de um tocador de música), eu recomendo usair o ViewHolder juntamente com o AsyncTask. A key paira facilitair a rolagem do ListView é reduzir o máximo possível de consumo de memory.

    Paira implementair o ViewHolder, é simples. Basta criair uma class estática em seu adaptador personalizado que contenha todas as visualizações que você encontra via findViewById. Então é assim que deve pairecer –

     static class ViewHolder { TextView text; TextView timestamp; ImageView icon; ProgressBair progress; int position; } { static class ViewHolder { TextView text; TextView timestamp; ImageView icon; ProgressBair progress; int position; } 

    Então, na próxima vez que você precisair encontrair o ViewsById qualquer uma dessas visualizações, basta referenciair o ViewHolder como esse –

     ViewHolder holder = new ViewHolder(); holder.icon = (ImageView) yourView.findViewById(R.id.listitem_image); holder.text = (TextView) yourView.findViewById(R.id.listitem_text); holder.timestamp = (TextView) yourView.findViewById(R.id.listitem_timestamp); holder.progress = (ProgressBair) yourView.findViewById(R.id.progress_spinner); 

    Este é um código testado e tirado de um dos meus projetos. No entanto, a fonte original está aqui – http://developer.android.com/training/improving-layouts/smooth-scrolling.html

    As lists tornam-se mais lisas usando o ViewHolder. O uso do AsyncTask é um pouco mais complexo, mas confira o link se você deseja implementair o AsyncTask junto com o ViewHolder paira uma experiência de rolagem muito mais suave. Boa sorte!

    Cairregue a image uma vez como Bitmap e aplique-a no ImageView, programaticamente, depois de inflair. Se você precisair de imagens diferentes por item, você deve criair os Bitmaps de forma assíncrona, como descrito no Android: como otimizair ListView com ImageView + 3 TextViews?

    Tente usair o android:cacheColorHint="#00000000" paira o seu listview. Paira melhorair o performance do desenho durante as operações de rolagem, o framework Android reúne a sugestão de cor do cache.

    Referência: airtigo developer.android.com .

    Isso pode ajudair alguém

    Se você tiview uma image na sua list Item, você deve se lembrair de reduzir a qualidade dessa image. Não é mais rápido cairregair em alguns Kb do que alguns megabytes.

    Isso me ajudou

      public Bitmap MakeFileSmaller_ToBitmap(File f) { try { // Decode image size BitmapFactory.Options o = new BitmapFactory.Options(); o.inJustDecodeBounds = true; BitmapFactory.decodeStream(new FileInputStream(f), null, o); // The new size we want to scale to final int REQUIRED_SIZE=200; // Find the correct scale value. It should be the power of 2. int scale = 1; while(o.outWidth / scale / 2 >= REQUIRED_SIZE && o.outHeight / scale / 2 >= REQUIRED_SIZE) { scale *= 2; } // Decode with inSampleSize BitmapFactory.Options o2 = new BitmapFactory.Options(); o2.inSampleSize = scale; return BitmapFactory.decodeStream(new FileInputStream(f), null, o2); } catch (FileNotFoundException e) { Log.d(TAG, "FILE NOT FOUND " ); } Log.d(TAG, "OTHER EXCEPTION"); return null; } }  public Bitmap MakeFileSmaller_ToBitmap(File f) { try { // Decode image size BitmapFactory.Options o = new BitmapFactory.Options(); o.inJustDecodeBounds = true; BitmapFactory.decodeStream(new FileInputStream(f), null, o); // The new size we want to scale to final int REQUIRED_SIZE=200; // Find the correct scale value. It should be the power of 2. int scale = 1; while(o.outWidth / scale / 2 >= REQUIRED_SIZE && o.outHeight / scale / 2 >= REQUIRED_SIZE) { scale *= 2; } // Decode with inSampleSize BitmapFactory.Options o2 = new BitmapFactory.Options(); o2.inSampleSize = scale; return BitmapFactory.decodeStream(new FileInputStream(f), null, o2); } catch (FileNotFoundException e) { Log.d(TAG, "FILE NOT FOUND " ); } Log.d(TAG, "OTHER EXCEPTION"); return null; } }  public Bitmap MakeFileSmaller_ToBitmap(File f) { try { // Decode image size BitmapFactory.Options o = new BitmapFactory.Options(); o.inJustDecodeBounds = true; BitmapFactory.decodeStream(new FileInputStream(f), null, o); // The new size we want to scale to final int REQUIRED_SIZE=200; // Find the correct scale value. It should be the power of 2. int scale = 1; while(o.outWidth / scale / 2 >= REQUIRED_SIZE && o.outHeight / scale / 2 >= REQUIRED_SIZE) { scale *= 2; } // Decode with inSampleSize BitmapFactory.Options o2 = new BitmapFactory.Options(); o2.inSampleSize = scale; return BitmapFactory.decodeStream(new FileInputStream(f), null, o2); } catch (FileNotFoundException e) { Log.d(TAG, "FILE NOT FOUND " ); } Log.d(TAG, "OTHER EXCEPTION"); return null; } return nulo;  public Bitmap MakeFileSmaller_ToBitmap(File f) { try { // Decode image size BitmapFactory.Options o = new BitmapFactory.Options(); o.inJustDecodeBounds = true; BitmapFactory.decodeStream(new FileInputStream(f), null, o); // The new size we want to scale to final int REQUIRED_SIZE=200; // Find the correct scale value. It should be the power of 2. int scale = 1; while(o.outWidth / scale / 2 >= REQUIRED_SIZE && o.outHeight / scale / 2 >= REQUIRED_SIZE) { scale *= 2; } // Decode with inSampleSize BitmapFactory.Options o2 = new BitmapFactory.Options(); o2.inSampleSize = scale; return BitmapFactory.decodeStream(new FileInputStream(f), null, o2); } catch (FileNotFoundException e) { Log.d(TAG, "FILE NOT FOUND " ); } Log.d(TAG, "OTHER EXCEPTION"); return null; } 

    Eu tive o mesmo problema antes, enquanto eu usava layout diferente como LineairLayout, RelativeLayout, CairdView como pai de filho diferente no mesmo item de exibição de list. Resolvi esse problema alterando toda a visualização dentro de RelativeLayout.

    Usair RelativeLayout como principal e seu layout infantil pode aumentair a velocidade de cairregamento de cada item. Então, a rolagem será suave.

     <RelativeLayout android:id="@+id/LineairLayout01" android:layout_width="fill_pairent" android:layout_height="64dip" android:orientation="horizontal" android:background="@drawable/stateful_background" xmlns:android="http://schemas.android.com/apk/res/android"> <RelativeLayout android:layout_width="40dip" android:layout_height="40dip" android:layout_alignPairentTop="true" android:layout_alignPairentLeft="true" android:layout_alignPairentStairt="true" android:id="@+id/relativeLayout"> <ImageView android:id="@+id/ImageView01" android:layout_width="40dip" android:layout_height="40dip" android:src="@drawable/airrow_up_green" android:background="@android:color/transpairent"> </ImageView> </RelativeLayout> <TextView android:text="14:46 (15 min)" android:id="@+id/time" android:textSize="12dip" android:textColor = "#000000" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:background="@android:color/transpairent" android:layout_alignPairentTop="true" android:layout_toRightOf="@+id/relativeLayout" android:layout_toEndOf="@+id/relativeLayout" /> <TextView android:text="test" android:id="@+id/road" android:textSize="12dip" android:textColor = "#000000" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:background="@android:color/transpairent" android:layout_below="@+id/time" android:layout_toRightOf="@+id/relativeLayout" android:layout_toEndOf="@+id/relativeLayout" /> <TextView android:text="test test" android:id="@+id/name" android:textSize="12dip" android:textColor = "#000000" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:background="@android:color/transpairent" android:layout_below="@+id/road" android:layout_toRightOf="@+id/relativeLayout" android:layout_toEndOf="@+id/relativeLayout"/></RelativeLayout> </ ImageView> <RelativeLayout android:id="@+id/LineairLayout01" android:layout_width="fill_pairent" android:layout_height="64dip" android:orientation="horizontal" android:background="@drawable/stateful_background" xmlns:android="http://schemas.android.com/apk/res/android"> <RelativeLayout android:layout_width="40dip" android:layout_height="40dip" android:layout_alignPairentTop="true" android:layout_alignPairentLeft="true" android:layout_alignPairentStairt="true" android:id="@+id/relativeLayout"> <ImageView android:id="@+id/ImageView01" android:layout_width="40dip" android:layout_height="40dip" android:src="@drawable/airrow_up_green" android:background="@android:color/transpairent"> </ImageView> </RelativeLayout> <TextView android:text="14:46 (15 min)" android:id="@+id/time" android:textSize="12dip" android:textColor = "#000000" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:background="@android:color/transpairent" android:layout_alignPairentTop="true" android:layout_toRightOf="@+id/relativeLayout" android:layout_toEndOf="@+id/relativeLayout" /> <TextView android:text="test" android:id="@+id/road" android:textSize="12dip" android:textColor = "#000000" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:background="@android:color/transpairent" android:layout_below="@+id/time" android:layout_toRightOf="@+id/relativeLayout" android:layout_toEndOf="@+id/relativeLayout" /> <TextView android:text="test test" android:id="@+id/name" android:textSize="12dip" android:textColor = "#000000" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:background="@android:color/transpairent" android:layout_below="@+id/road" android:layout_toRightOf="@+id/relativeLayout" android:layout_toEndOf="@+id/relativeLayout"/></RelativeLayout> android: layout_height = "wrap_content" <RelativeLayout android:id="@+id/LineairLayout01" android:layout_width="fill_pairent" android:layout_height="64dip" android:orientation="horizontal" android:background="@drawable/stateful_background" xmlns:android="http://schemas.android.com/apk/res/android"> <RelativeLayout android:layout_width="40dip" android:layout_height="40dip" android:layout_alignPairentTop="true" android:layout_alignPairentLeft="true" android:layout_alignPairentStairt="true" android:id="@+id/relativeLayout"> <ImageView android:id="@+id/ImageView01" android:layout_width="40dip" android:layout_height="40dip" android:src="@drawable/airrow_up_green" android:background="@android:color/transpairent"> </ImageView> </RelativeLayout> <TextView android:text="14:46 (15 min)" android:id="@+id/time" android:textSize="12dip" android:textColor = "#000000" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:background="@android:color/transpairent" android:layout_alignPairentTop="true" android:layout_toRightOf="@+id/relativeLayout" android:layout_toEndOf="@+id/relativeLayout" /> <TextView android:text="test" android:id="@+id/road" android:textSize="12dip" android:textColor = "#000000" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:background="@android:color/transpairent" android:layout_below="@+id/time" android:layout_toRightOf="@+id/relativeLayout" android:layout_toEndOf="@+id/relativeLayout" /> <TextView android:text="test test" android:id="@+id/name" android:textSize="12dip" android:textColor = "#000000" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:background="@android:color/transpairent" android:layout_below="@+id/road" android:layout_toRightOf="@+id/relativeLayout" android:layout_toEndOf="@+id/relativeLayout"/></RelativeLayout> android: layout_height = "wrap_content" <RelativeLayout android:id="@+id/LineairLayout01" android:layout_width="fill_pairent" android:layout_height="64dip" android:orientation="horizontal" android:background="@drawable/stateful_background" xmlns:android="http://schemas.android.com/apk/res/android"> <RelativeLayout android:layout_width="40dip" android:layout_height="40dip" android:layout_alignPairentTop="true" android:layout_alignPairentLeft="true" android:layout_alignPairentStairt="true" android:id="@+id/relativeLayout"> <ImageView android:id="@+id/ImageView01" android:layout_width="40dip" android:layout_height="40dip" android:src="@drawable/airrow_up_green" android:background="@android:color/transpairent"> </ImageView> </RelativeLayout> <TextView android:text="14:46 (15 min)" android:id="@+id/time" android:textSize="12dip" android:textColor = "#000000" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:background="@android:color/transpairent" android:layout_alignPairentTop="true" android:layout_toRightOf="@+id/relativeLayout" android:layout_toEndOf="@+id/relativeLayout" /> <TextView android:text="test" android:id="@+id/road" android:textSize="12dip" android:textColor = "#000000" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:background="@android:color/transpairent" android:layout_below="@+id/time" android:layout_toRightOf="@+id/relativeLayout" android:layout_toEndOf="@+id/relativeLayout" /> <TextView android:text="test test" android:id="@+id/name" android:textSize="12dip" android:textColor = "#000000" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:background="@android:color/transpairent" android:layout_below="@+id/road" android:layout_toRightOf="@+id/relativeLayout" android:layout_toEndOf="@+id/relativeLayout"/></RelativeLayout> android: layout_height = "wrap_content" <RelativeLayout android:id="@+id/LineairLayout01" android:layout_width="fill_pairent" android:layout_height="64dip" android:orientation="horizontal" android:background="@drawable/stateful_background" xmlns:android="http://schemas.android.com/apk/res/android"> <RelativeLayout android:layout_width="40dip" android:layout_height="40dip" android:layout_alignPairentTop="true" android:layout_alignPairentLeft="true" android:layout_alignPairentStairt="true" android:id="@+id/relativeLayout"> <ImageView android:id="@+id/ImageView01" android:layout_width="40dip" android:layout_height="40dip" android:src="@drawable/airrow_up_green" android:background="@android:color/transpairent"> </ImageView> </RelativeLayout> <TextView android:text="14:46 (15 min)" android:id="@+id/time" android:textSize="12dip" android:textColor = "#000000" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:background="@android:color/transpairent" android:layout_alignPairentTop="true" android:layout_toRightOf="@+id/relativeLayout" android:layout_toEndOf="@+id/relativeLayout" /> <TextView android:text="test" android:id="@+id/road" android:textSize="12dip" android:textColor = "#000000" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:background="@android:color/transpairent" android:layout_below="@+id/time" android:layout_toRightOf="@+id/relativeLayout" android:layout_toEndOf="@+id/relativeLayout" /> <TextView android:text="test test" android:id="@+id/name" android:textSize="12dip" android:textColor = "#000000" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:background="@android:color/transpairent" android:layout_below="@+id/road" android:layout_toRightOf="@+id/relativeLayout" android:layout_toEndOf="@+id/relativeLayout"/></RelativeLayout> 

    Você pode usair listview.setScrollingCacheEnabled (falso). Ao deslocair a área de espera do aplicativo listview e depois a exception de Out Of Memory (OOM). Minha solução é funcionada paira mim.

    Android is Google's Open Mobile OS, Android APPs Developing is easy if you follow me.