Bypassing dialog bug in Android - android

I have an application which in certain areas, a dialog pops up and restricts the user from proceeding. There are currently two types of dialogs. One restricts the user entirely from proceeding and the other allows the user to proceed if they click on "OK".
The problem:
When the dialog appears, if I close the application and relaunch it, the app bypasses the dialog and gains access to the next screen. On one of the cases, the app bypasses the screen and shows that screen which the user was previously on before the dialog appeared.
Does anyone have an idea what may be the problem?

Related

How to disable "Screen is Pinned" dialog android from kiosk mode

iam developing screenlock app for android using a React Native and a little annoyed with the screen pinned dialog that always appears, is there a way to just get rid of it? so what I really want is no dialogue interaction at all with the user
enter image description here
If you're calling startLockTask() and your device isn't set up as a dedicated device with your app whitelisted, then no you can't prevent it:
Otherwise, the current task will be launched into screen pinning mode. In this case, the system will prompt the user with a dialog requesting permission to use this mode. The user can exit at any time through instructions shown on the request dialog.
The dialog is there to help users understand what's happening, give permission for the app to take over their screen, and know how to get out of it later. It's baked into Android by design, so malicious apps can't cause problems - it's just a limitation you have to deal with, unless you're working with a dedicated device (which can be set up to give apps more control and users less)
Have you thought about immersive mode instead, where you hide the nav bar? The user can get out of that too by swiping to reveal the controls, but it's less intrusive. There's no way to automatically lock the user's screen with no interaction though

How to dismiss permissions dialog programmatically?

When the user pauses/closes the screen, while a permissions prompt dialog is active, the dialog persists over the locked screen when the user tries to use the phone again (and needs to make a choice for the dialog to go away).
Although a detail, it does not look very nice, and I would like to dismiss that prompt dialog in onPause(). How can I do that? Perhaps I should programmatically choose to deny permissions in onPause() instead?
From another point of view, it is also not very nice that user can't continue his task when returning to your app.
So, persistent dialog is a feature and the point is that user decides when to deny or accept permissions - it's the best to not do anything programmatically

How to hide the pop up for my application?

Have a look on the below pic
The foreground pop up is handsent sms app.The back ground is my app. My problem is whenever an sms received popup window opens.The bad thing is even my app runs .Their pop up box may disturb my app users.How can block their pop up on my screens. The dafault sms app is opened then handsent sms app wont show popup on the window.Like that I also want to block other popup on my app screens.
Their pop up box may disturb my app users..How can block their pop up on my screens
You don't know that. This is not something you should try to control, if the user has an app that pops up, that is probably their preference. Your app should however be prepared for interruptions, i.e handle your app's lifecycle properly

Android Notification - Popup dialog box

i am trying to create a dialog box to appear in the middle of the screen when my main program is not in focus and running in background. The purpose of the dialog box is to force the user to take an immediate action. I am already using the notification manager to notify the user but i would still like a old school popup dialog box.
Thanks :D
Popping up a dialog from an application running in the background is thought of as bad practice because it may confuse the user, and may annoy the user because you are disrupting the current task s/he is engaged in.
It is advised by the Android developers to use the Android notification system for tasks like these. A guide to create notifications is here: http://developer.android.com/guide/topics/ui/notifiers/notifications.html
Dialogs are created with the Intent of the current activity. Since your app will not be in focus at the time, you cannot create a dialog.

Android: Determine the previously displayed external Activity

In my application, I used a library that displays ads in my app. When a user clicks on the ad, it launches the Browser app, and the onClick events are handled by the library itself.
I also have a placed code in onPause() and onStart() methods that detects whether any of my Activities are sent to background (user pressed Home) or switching between any of my Activities.
So if the app is either freshly opened (no instance is running) or re-opened from background, it will display a dialog box. If the user is only switching from any of my Activites, then the dialog box shouldn't be displayed.
Now the problem is that when the user clicks on an Ad, the Browser app gets loaded and would mean that my App has been sent to background, and so when the user closes the Browser, it will still display the dialog box when it shouldn't.
Is it even possible for my App to determine the previously displayed external Activity (ie. Browser) and not display the dialog box?
Or are there better approaches that I can follow in implementing such setup?
Thanks in advance.
I don't think that there is a way for your Activity to know, which was the previous activity. A simple work-around is to save the time the dialog was displayed and not displayed it again, before some time passes. You can decide on the exact time period based on your application's requirements.
This may be in fact better in some situations. If the user switches from the Browser to your application and it has been some time he has used your application, it will be appropriate to show the dialog again.
you can use onResume() method to specify the behaviour when your activity get back from the background.

Categories

Resources