Click here to Skip to main content
15,868,340 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have an activity it starts the service whenever user swipes to refresh.This service download some data from Internet and store it in shared preferences and put some Extras in intent to send to the activity.And In activity OnNewIntent() I am perfectly getting everything that I have put in that intent before.And on the base of these extras activity will get data from shared preferences and show it in listView. Every thing is fine i am not getting any kind of exceptions.

But the problem is:

when i swipe down to refresh (service will be started) and on that time I receive a phone call and my application's activity hides and phone call shows up so that i can pick up the phone call.Remember Service was already started before so when service completes its download task it starts the activity like i am pasting code:

Java
//where i is intent and I have initialized it so no worries!
i.setAction("xxxxx.CUSTOM_ACTION");
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
i.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
startActivity(i);

and that activity shows up during the phone call.I don't want it to show up,I want that activity to stay wherever it was even when service starts it by sending some intent. Please tell me if there is any intent flag that can solve my problem.Any help would be appreciated! if have any confusion about the problem do tell me I can explain more briefly.
Posted
Updated 22-Aug-14 6:53am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900