Being that we don't know what kind of phone you have, I can only assume you replaced it yourself and may have installed it improperly. If it is an iPhone, you might consider making a genius bar appointment with the nearest Apple Store to have them install it correctly or diagnose why your device isn't detecting the battery.