Start Intent in Adapter

前端 未结 8 1812
清酒与你
清酒与你 2021-02-02 13:32

I want to start a new activity from this base adapter.

public class EfficientAdapter extends BaseAdapter {

    private Activity activity;
    private ArrayList         


        
8条回答
  •  眼角桃花
    2021-02-02 13:59

    Replace onClick method with this it may work I didn't tried:

    @Override
    public void onClick(View v) {    
        v.getContext().startActivity(new Intent(v.getContext(), NVirementEmmeteur.class)); 
    }
    

提交回复
热议问题