I have devoleped an application and the problem with that application is that Its crashing when we keep it in background for more than 15 mins

On clicking application Icon It should come to foreground but its showing application stopped/ANR message.

So what exactly I have to do so that It will not crash

I think I should concentrate on life cycle methodologies.

Please suggest me a solution for this

Help is always appreciated,

Thanks in advance.