I have done the following code inside of my getView() method of CustomAdapter class. If I try to simply show a Toast, Toast appears, but if i do the following code to make a call, application crashes. What i am doing wrong here?
                call.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    Intent callIntent = new Intent(Intent.ACTION_CALL);
                    callIntent.setData(Uri.parse("tel:" + phone.getText().toString()));
                    context.startActivity(callIntent);
                }
            });
and the stacktrace shows this error :
AndroidRuntime: FATAL EXCEPTION: main Process: com.example.hammad.contactme, PID: 26713 android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag.
 
    