broadcastreceiver

Android Display own lock instead of default when screen on/off

无人久伴 提交于 2019-12-04 19:08:26
i want to open my created lock instead of default one,when phone is boot at that time my lock is called. But i want to know when my screen on after locked at that time how i called my lock (my lock activity)Means i want to display my lock instead of default at time of screen on or phone restart or switch on all time. like in our phone lock called all time same as i want to call my lock all time( done with boot ).so please any one help me how i call my lock when screen on/off.please help quickly thanks.... i do for boot time call my lock following exactly i that i want for screen-on/off {

I need to implement Notification Reminder in my android app

人走茶凉 提交于 2019-12-04 18:59:12
My Requirment: I want my application to show a reminder notification on every Friday @ 8 am I have used AlarmManager, BroadcastReceivers to implement my reminder notification. The problem I am getting is, When I set notification time using current system time and Add 2 minutes in it... It works perfectly when I use it in this way, it trigger my notification exactly after 2 minutes. But, When I use calender instance to set notification time at specific time of any day, it trigger my reminder notification when ever I start/open my app on my device/emulator and secondly it wont trigger

Confusion about WakefulBroadcastReceiver

☆樱花仙子☆ 提交于 2019-12-04 18:31:56
I've been studying WakefulBroadcastReceiver from this link : https://developer.android.com/reference/android/support/v4/content/WakefulBroadcastReceiver.html I have few confusions regarding this: Does this receiver ensures that you'll receive the broadcast even when the device is in sleep mode? (I think no, it just keeps the device awake after receiving the broadcast until a call to completeWakefulIntent() is made.) The documentation illustrates the use of intent service within the receiver and after the completion of work, a call to completeWakefulIntent is made. CODE : import android.app

Incoming number during a call in android?

淺唱寂寞╮ 提交于 2019-12-04 17:41:23
I am running following code, its compiling but I am not getting any result or toast displayed please help... CustomBroadcastReceiver.java this class will receive the action phone state change and will instantiate the customephonestatelistener public class CustomBroadcastReceiver extends BroadcastReceiver { TelephonyManager telephony = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE); CustomPhoneStateListener customPhoneListener = new CustomPhoneStateListener(context); telephony.listen(customPhoneListener, PhoneStateListener.LISTEN_CALL_STATE); Bundle bundle = intent

sending sms to multiple contacts using loop

試著忘記壹切 提交于 2019-12-04 17:38:25
I am working on an android sms application.I have to send sms to multiple contact.There is method available to send sms to multi contacts so i used for loop.The following is my code. for (int i = 0; i < to_nums.size();i++) { sendSms(to_nums.get(i), snd_txt.getText().toString() ); } public void sendSms(final String phoneNumber, final String message){ String SENT = "SMS_SENT"; String DELIVERED = "SMS_DELIVERED"; PendingIntent sentPI = PendingIntent.getBroadcast(this, 0, new Intent(SENT), 0); PendingIntent deliveredPI = PendingIntent.getBroadcast(this, 0, new Intent(DELIVERED),0); //--- When the

Geofence events not always called

*爱你&永不变心* 提交于 2019-12-04 17:17:53
This is how I add my geofences: public void setGeofenceRequest(Location location) { if (geofences == null) { geofences = new ArrayList<Geofence>(); } geofences.add(new Geofence.Builder() .setRequestId("3") .setTransitionTypes(Geofence.GEOFENCE_TRANSITION_EXIT) .setCircularRegion( location.getLatitude(), location.getLongitude(), PSLocationService.getInstance(context).kPSGeofencingDistanceMedium) .setExpirationDuration(Geofence.NEVER_EXPIRE) .build()); Intent intent = new Intent(context, ReceiveTransitionsBroadcastReceiver.class); PendingIntent pi = PendingIntent.getBroadcast(context, 0, intent,

Not able to catch each sms status

偶尔善良 提交于 2019-12-04 17:14:44
Im trying to catch the status of each sms delivery but my code is not getting it but instead the status of only one message. Anyone can give hints? This si my code.. This is working but I need to catch each status of each sms. public void sendMultipart(String msgbody,String msg_receipients,Intent intent) { BroadcastReceiver smsStatusReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { context.unregisterReceiver(this); //unregister receiver switch (getResultCode()) { case Activity.RESULT_OK: Logger.logtoFile(tag,"RESULT_OK "+intent

How to determine the type of an extra in a bundle held by intent?

℡╲_俬逩灬. 提交于 2019-12-04 17:12:22
问题 I am trying to pass arbitrary data to a BroadcastReceiver through its Intent . So I might do something like the following intent.putExtra("Some boolean", false); intent.putExtra("Some char", 'a'); intent.putExtra("Some String", "But don't know what it will be"); intent.putExtra("Some long", 15134234124125); And then pass this to the BroadcastReceiver I want to iterate through Intent.getExtras() with something like keySet() , but I would also like to be able to get the value of the key without

Android receiver for multiple actions?

我的未来我决定 提交于 2019-12-04 17:00:16
问题 Simple question - Can I register a single BroadcastReceiver to multiple Intent actions? Here's what I'm considering: <receiver android:name=".myReceiver"> <intent-filter android:priority="1000000"> <action android:name="android.intent.action.MEDIA_BUTTON" /> <action android:name="android.intent.action.ACTION_HEADSET_PLUG" /> </intent-filter> </receiver> So in myReceiver class' onReceive , could I check intent.getAction() for both ACTION_MEDIA_BUTTON and ACTION_HEADSET_PLUG ? 回答1: I guess you

Kotlin: Unresolved local class when using BroadcastReceiver in Activity

妖精的绣舞 提交于 2019-12-04 16:55:54
问题 From time to time when compiling the project I get this error: Error:java.lang.UnsupportedOperationException: Unresolved local class: com/myproject/activities/BaseActivity$broadcastReceiver$1 at org.jetbrains.kotlin.descriptors.NotFoundClasses$classes$1.invoke(NotFoundClasses.kt:44) at org.jetbrains.kotlin.descriptors.NotFoundClasses$classes$1.invoke(NotFoundClasses.kt:32) at org.jetbrains.kotlin.storage.LockBasedStorageManager$MapBasedMemoizedFunction.invoke(LockBasedStorageManager.java:408)