Category : broadcastreceiver

This is my code, Here on the method called checkPermissionsUsers I am verifying the permissions of the user to write external storage private void checkPermissionsUsers() { dialog = new AlertDialog.Builder(MainActivity.this) .setTitle("New version available") .setMessage("Please, update app to new version to continue reposting.") .setPositiveButton("Update", new DialogInterface.OnClickListener() { @RequiresApi(api = Build.VERSION_CODES.M) @Override public void onClick(DialogInterface dialog, int ..

Read more

I want to send notifications from my Android app every minute to the user if a certain condition is met. I read about Periodic Work Request by Work Manager, however the minimum time interval is 15 minutes. How can I set the minimum time to 1 minute instead? The android device is running on Android ..

Read more

I am building an Android application. In my app, I need to run a task in the background even when the app is closed every 15 seconds or so. I am using Broadcast receiver for that. This is my broadcast receiver. class RegisterReceiversScheduler: BroadcastReceiver() { private lateinit var handler: Handler private lateinit var context: Context ..

Read more

I want to know the target selected by user when sharing content with Android Sharesheet. I follow instructions from Android’s developer guide: getting information about sharing. However the broadcast receiver’s onReceive() is never called. Sample code: //! This class receives sharing completion notifications public static class SharingReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, ..

Read more

i have created a demo for schadule local notification using AlarmManager & BroadcastReceiver. Demo working proper if application is in forground mode or in background mode but after removed from the recent tab domo not working properly(BroadcastReceiver not calling). If i will set Don’t optimise in bettery optimisation from setting then demo working proper in ..

Read more

I just want to pop the Title to the notification but this is return null object. I need help pls, my English is very bad I hope everyone will sympathy :D. Error: Caused by: java.lang.NullPointerException: Attempt to invoke virtual method ‘java.lang.String com.example.a.Work.getTitle()’ on a null object reference at com.example.a.AlertBrr.onReceive(AlertBrr.java:24) CreateActivity.class Work work = new Work(); ..

Read more