Start Intent in Adapter

前端 未结 8 1686
清酒与你
清酒与你 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:00

    I faced this problem previously and tried all of the suggestions above, but the only one helped me to start an activity from an adopter was the solution proposed by @Md. Sajedul Karim.

    I modified the code and used like this

    Intent intent = new Intent(context, NesneTani.class);
    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    context.startActivity(intent);
    

提交回复
热议问题