Why does my oil light come on and off ? on 2005 Dodge Magnum

The oil has been changed and is clean. There are no codes coming up. This occurs when the engine is warmed up. Sometimes the light stays on for a few seconds then goes off, only to have it come back on soon. I have taken it to the dealership and they couldn't find anything wrong with it.

have you checked the oil pressure with a gauge? could be a oil pressure sensor
No, I haven't but I will try that. Thank you. I did replace the oil pressure sensor a couple years ago. Thank you. I'll let you know if it works. I had no idea what to do next.
no problem thats what we are here for...
It was the oil pressure sensor. I had the original one replaced about a year ago but my car doesn't do well with after market parts. I had to get one from a dealership, it took awhile but now it works great, and no light. Thank you for your reply.
ur welcome
1 more answer
You need the oil pressure checked most likely if its not the sensor it could be the oil pump that needs replacement