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 ..
Category : broadcastreceiver
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 ..
I have an app that disables users from accessing any OS setting including the notification panel. So when the battery gets below 5% the brightness dims very low and makes the phone essentially unusable. Is there a way to disable the brightness to be altered by the system? Or do I have to maybe listen ..
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 ..
This is an odd one. I have written a simple app to actually solve a communication problem for my wife and I during the day. The app is simple…but it solves the problem. To work effectively, the app required SMS_READ and SMS_RECEIVE permissions as well as SEND_SMS. This is not a text messaging app, but ..
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, ..
I want to schedule a task for every minute on my application and want the task to be executed even when the application/activity is not opened in foreground. How can I achieve that? I am running my application on an Android emulator on API 30. Source: Android..
i have a apk that runs in place of home and its always active on the screen. i nee dto make a broadcastreceiveror a service that can get any pressed button from a usb headset that is connected to my cell phone and make a Toast telling what button was pressed. im trying to do ..
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 ..
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(); ..
Recent Comments