android - get current system time in broadcast reciever -
i using below code time in broadcastreceiver
on call performed i'm getting same value after making outgoing call. geting time code works when used activity
it's throwing same value in broadcastreceiver.
@override public void onreceive(context context, intent intent) { simpledateformat s = new simpledateformat("hhmmss"); string time= s.format(new date()); system.out.println(time); }
receiver
<receiver android:name="com.pairdroid.information.outcalllogger" > <intent-filter> <action android:name="android.intent.action.new_outgoing_call" /> </intent-filter> </receiver>
your time format string wrong try replace :
format formatter = new simpledateformat("hh:mm:ss a");
Comments
Post a Comment