Gostaria de saber como eu poderia fazer para chamar uma outra activity, através de um item da lista onde os dados são utilizados do site parse.com. Por exemplo, tenho esse código:
public class ListViewAdapterPizzarias extends BaseAdapter {
// Declare Variables
Context context;
LayoutInflater inflater;
ImageLoader imageLoader;
private List<WorldPopulation> worldpopulationlist = null;
private ArrayList<WorldPopulation> arraylist;
public ListViewAdapterPizzarias(Context context,
List<WorldPopulation> worldpopulationlist) {
this.context = context;
this.worldpopulationlist = worldpopulationlist;
inflater = LayoutInflater.from(context);
this.arraylist = new ArrayList<WorldPopulation>();
this.arraylist.addAll(worldpopulationlist);
imageLoader = new ImageLoader(context);
}
public class ViewHolder {
TextView nome;
TextView telefone;
TextView endereco;
TextView status;
}
@Override
public int getCount() {
return worldpopulationlist.size();
}
@Override
public Object getItem(int position) {
return worldpopulationlist.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
public View getView(final int position, View view, ViewGroup parent) {
final ViewHolder holder;
if (view == null) {
holder = new ViewHolder();
view = inflater.inflate(R.layout.item_lista_pizzarias, null);
// Locate the TextViews in listview_item.xml
holder.nome = (TextView) view.findViewById(R.id.nome);
holder.endereco = (TextView) view.findViewById(R.id.endereco);
holder.telefone = (TextView) view.findViewById(R.id.telefone);
holder.status = (TextView) view.findViewById(R.id.status);
view.setTag(holder);
} else {
holder = (ViewHolder) view.getTag();
}
// Set the results into TextViews
holder.nome.setText(worldpopulationlist.get(position).getNome());
holder.endereco.setText(worldpopulationlist.get(position).getEndereco());
holder.telefone.setText(worldpopulationlist.get(position).getTelefone());
holder.status.setText(worldpopulationlist.get(position).getStatus());
///teste
// Listen for ListView Item Click
view.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
// Send single item click data to SingleItemView Class
Intent intent = new Intent(context, MainActivity.class);
//O que colocar aqui para buscar o dado do site parse.com e chamar a outra activity?
}
});
return view;
}
}