I am developing a Chat App, the app is in closed state. The Caller A makes a Call to another user B. The User's B app open, IncomingCallActivity.java there is reject call button, when reject button is clicked the call get disconnected but the app is not closed. The IncomingCallActivity always remains in minimised state. How to handle this?
Asked
Active
Viewed 485 times
3
-
Possible duplicate of [How to close Android application?](https://stackoverflow.com/questions/2092951/how-to-close-android-application) – nima moradi Jan 15 '19 at 17:17
-
Call `finish()` to close an activity. – Srikar Reddy Jan 15 '19 at 18:17
-
@SrikarReddy finish() will just close the activity , i need to clear the app from background – Gokul Rajkumar Jan 23 '19 at 15:53
-
Are you trying to close app after termination of call? Is this your expectation? – MohanRaj S Jan 23 '19 at 16:16
-
@MohanRajS Yes i am trying to close the application – Gokul Rajkumar Jan 24 '19 at 06:28
1 Answers
4
you should set excludeFromRecents
to true
for your IncomingCallActivity
in Manifest file :
<activity
android:name=".IncomingCallActivity"
android:excludeFromRecents="true">
</activity>
or you can set flag to intent that opens IncomingCallActivity
:
Intent incomingCallActivityIntent=new Intent(this,IncomingCallActivity.calss);
incomingCallActivityIntent.addFlag(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
startActivity(incomingCallActivityIntent);
and after call finished call finish()
method

mostafa3dmax
- 997
- 7
- 18