how to open call log from broadcastreceiver - broadcastreceiver

how to open call log from broadcastreceiver
am using a broadcast receiver to monitor call is coming from which number...
and for that i need to open calllog to show to the user
how to open call log from broadcastreceiver?

After a long search in stackoverflow.com
now i can open call log from broadcast receiver using
Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse("content://call_log/calls"));
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(i);

Related

Socket connection is not closed, then navigate back to Launchpad

I have an Fiori Elements application, which consumes an Socket connection over the object:
sap/ui/core/ws/WebSocket
If an message is send to the Frontend, the App shows an PopUp.
Problem:
User uses APP
User navigates to Launchpad
Socket connection is not closed
Message is send by Socket
PopUp is shown in Launchpad
How can I achieve that no PopUp is displayed?
Solution was simple, implement onExit method of Controller would do the trick
onExit() {
this.socket.close();
}
In case if a WebSocket object is created in the Component.js, be sure that the WebSocket is initialized in the Component init() function and call the WebSocket close() method in the Component exit() function.

Event should trigger when Toastr notification appears

i want to trigger an event using protractor for close the Toastr notification messages. whenever the notification appears this event should triggered.. is this possible??
I have 10 forms ,i am validating these forms using protractor. In each form i have editable text fields. If you add/edit/delete any fields you will get toastr notification message. I want to close these messge whenever it appears in my appliaction.
is this possible?? Thanks in advance..
You can execute JS code while running your test for closing toastr notification, you could try this one (I tested it in their demo project - run this code toastr.remove() in a console when toastr notification was shown):
await browser.executeScript(toastr.remove())
note that browser.executeScript() return Promise so you need to resolve it.

get status of SIP invite of Freeswitch

I am new to Freeswitch.
I have successfully connected two FSs. First FS redirects to second FS.
Now I would like to get the information about the SIP invite; whether it is received at 2nd FS or not programmatically, when call is made to 1st FS. I am open to scripting option as well apart from configuring the xml files.
You can write script which will listen for channel states on ESL interface of second Freeswitch, when call will hit extension of it you should get CHANNEL_CREATE event:
https://wiki.freeswitch.org/wiki/Event_List#Channel_events
More about ESL:
https://freeswitch.org/confluence/display/FREESWITCH/mod_event_socket

How To Resume Atmosphere Connection When User Cancel Closing Browser Window

Our application is using atmosphere as the comet implementation,we want to implement the functionality that user can choose to stay within the site after browser window is closing by prompting the user "Are you sure" dialogbox .
To be specific, the problem originate from the fact that when user is trying to close browser window, when the confirm dialogbox is showing, the disconnect event is fired to atmosphere server no matter what user is going to choose.
We are using atmosphere for GWT, and we tried using the resumeOnBroadcast on resource option ,but with no luck.
And we also tried to intercept the closing event before it fired, also failed.
So can somebody help, thx a lot.
Take a look at the onClose(AtmosphereResponse) request handler.
var socket = $.atmosphere;
var request = new $.atmosphere.AtmosphereRequest();
request.onClose(response){
//handle the close here
}
var subSocket = socket.subscribe(request);
subSocket.push(data);
This is documented here. This is on the client side.

Opening an email client on clicking a button

I am designing an app in which i need open an email client on clicking a button. The email client should be opened with pre defined subject,'to' address and from address of the user. Is there a way to attain this??? Plz provide me the solution and code if possible...
If you want to open the existing BlackBerry messages application use the Invoke class with the appropriate MessageArguments e.g.
Invoke.invokeApplication(Invoke.APP_TYPE_MESSAGES, new MessageArguments(MessageArguments.ARG_NEW, <to address>, <subject>, <body>);
I don't know of a way to change the from address.