Start Intent in Adapter

前端 未结 8 1682
清酒与你
清酒与你 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 14:04

    also you can do like, Here mContext is Your BaseAdpter Context Object

     Intent ieventreport = new Intent(mContext,Your.class);   
     mContext.startActivity(ieventreport);
    

    change your Constructer like, initialise

     public EfficientAdapter(Context context, ArrayList d){
    }
    

提交回复
热议问题