I'm calling call activity from my adapter but getting below error -
11-29 13:10:41.193: E/AndroidRuntime(12623): android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?
code -
Intent callIntent = new Intent(Intent.ACTION_CALL);
callIntent.setData(Uri.parse("tel:"+mMobileList.get(position)));
callIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
((Activity)mContext).startActivity(callIntent);
I have added FLAG_ACTIVITY_NEW_TASK also.Still getting error.How to resolve it?