Android :: Activity Is Displayed After User Unlocks The Screen
Mar 31, 2010
I was wondering if anyone understood how to make your application be displayed when you unlock the screen. I have an application where the user turns on a Bluetooth device, it connects to the phone, and the user should be presented with a UI. Having them hunt for the app or using the notification menu is not a workable option (too much work and not the obvious behavior).
The problem is that:
When the screen is unlocked:
- you can popup the activity from the background service when Bluetooth connects to a device
- User is happy because the UI is right there
When the screen is locked:
- The application gets started but is destroyed
- User unlocks the phone and nothing is there but the homescreen
One work around would be to disable the keyguard when the application gets woken up but the nuclear option is a pretty bad option. I know the standard Android assumption is that you shouldn't do this. In the normal case this behavior is fine, but in this case I explicitly did something I want the phone to respond without adding more work for the user to do. As per Google's guidelines if you don't like this behavior there can be an option for you to turn this off or you can not use the application.
A few more details, so after looking at this a bit more the problem isn't necessarily that you can't have an activity running when the screen is locked, unlock and expect it to be waiting. That does work if you do something like the following: lock your device run an app through Eclipse while the phone is locked/off unlock and it will be waiting for you.
But in the case the Activity is already running and I'm brining up a new window (which happens to be a transparent one, saying you're connected and asking what they want to do).
The problem is that it gets killed
CODE:..................
The setup here is as follows:
MyBackgroundService is a serivce that handles Bluetooth state (waits for connections, turns on Bluetooth if the user starts the app, etc.). It triggers a popup BackgroundPOPUP activity that runs a ViewFlipper.
MyBackgroundService starts BackgroundPOPUP through an intent.
BackgroundPOPUP is an activity with a Translucent theme (Theme.Translucent to be precise), it shows a ViewFlipper with some instructions and presents some options.
View 1 Replies
May 10, 2010
Is there an intent that is fired when a user unlocks their screen? I want my app to adjust the brightness when the screen turns on, but the problem im running into is that the screen on intent is fired on the lock screen and it does not adjust the display on that screen.
View 1 Replies
View Related
Apr 22, 2009
Is it possible to get listed the apps or activity which are actually displayed on the screen of the android mobile. I need to display a text box on some event when no acitivity is displayed, excepting the home screen.
View 3 Replies
View Related
Apr 9, 2009
Step 1: I am subclassing WebView and rendering html content properly. The intial content is very small with a div and image /link This is displayed in a LInear Layout along with a TextView and ListView. That is my first screen/activity of the application.
Step 2: When I click on a link on this webview, it goes through the webViewclient and expands to full screen to fit the content of the requested page.
After Step 2, I am not able to go back to my activity screen once the content is displayed. When I click on the back button to getback to my activity screen close my activity and goes to the phone's applications desktop. (i.e goes out of my application).
Step 3: In order to fix this issue, I stopped setting my own subclasssed WebViewClient. After doing this, the it seems to render the clicked page in a webView as subactivity. Now When I click on backbutton, it goes back to the activity screen. But, the issue now is, I am not catch event when a link is clicked. How can I catch click events in this case.
View 2 Replies
View Related
May 26, 2010
I have a service which starts at boot up time, the service code needs the intent of following scenarios.
1) When the phone locks(after time out)
2)When the user unlocks the screen (by dragging the screen lock object)
There doesn't appear to be an API available where an application can be notified when the device is locked or unlocked. It is important the this application be notified of these events, since the service utilizes the proximity sensor which does not shutdown when the device goes into suspend. The app will need to unload the prox sensor manually to save battery when the device gets locked, and reload the prox after the device is unlocked again.
View 3 Replies
View Related
Jun 17, 2010
I have Two activities One splash screen, Player screen. When user clicks on my app icon first splash screen is displayed and then player screen When player activity is running, if user returns to the home screen and then again clicks on app icon, the application is starting from the splash screen again.can any one please help me out how to do any one of below
1) I need to close current running activity and reload application.or
2) I need to resume to the player screen directly.Please give me an example or reference to follow, Im beginner in android programing.
View 3 Replies
View Related
May 18, 2009
I have a custom dialog displayed to input user info (ID). This appears on top of an activity with an 'Done' button, however when the edittext is selected and the soft keyboard appears, the keyboard obscures the Done button at the bottom of the dialog. The documentation / blog posts are a little dry on info specifically for dialogs, what do I need to include to get the dialog to pan up or otherwise?
View 5 Replies
View Related
Sep 3, 2010
Was this option removed or am I doing something wrong? Now I have to slide the dumb thing off the screen to unlock...
View 17 Replies
View Related
Apr 9, 2009
When MountService received event from HAL and start a notification, it would display an AlertActivity after user's click. However, I found the AlertActivity is created and can't be displayed.
I got some log as below:
CODE:........
Is it related to "FLAG_ACTIVITY_NEW_TASK"? however, how to solve it?
I've tried to use "launchmode as singleTask", but is doesn't work.
Is there anyone give me a hand? Why my activity can be created but can't be displayed?
View 3 Replies
View Related
Aug 19, 2010
I have some activities and I have to display a fullscreen ad image before displaying the activity... all my activities extends a custom activity and I thought it was a great idea to implement that advertisement there, so I did: code...
This works nice... the ad is displayed for 3 seconds and it closes automatically. The problem is that the activity that should be hide for the ad is being created faster, so the user can see it for a second before the ad is created. How can I avoid that behavior? How to make sure the ad activity starts before the another does?
View 1 Replies
View Related
Aug 21, 2010
I have a splash screen/loading screen that has .setVisibility() to GONE right after the draw call of my large bitmap is completed. The problem is the splash screen takes a bit to popup which i believe is due to the main activity booting up and doing CPU intensive applications on first run. Is there a way to get my splash screen displayed ASAP? Would it be ok if i had it in a different thread maybe? The splash screen is just a bitmap with a progressBar right below it. My layout is xml based so i cant see myself using setContentView.
View 2 Replies
View Related
Sep 22, 2010
Will i get charged for having the weather displayed on the main screen?
View 9 Replies
View Related
Aug 5, 2010
Using Google Maps on Android does anyone have any ideas on how to load only markers that would be displayed on the current screen? I'm thinking about sending a request to a web service that returns the lat/lng for the relevant markers. But what would the parameters be that I could use to calculate if a given lat/lng is within the screen?
View 1 Replies
View Related
Jul 15, 2009
I want my Toast to be displayed at specific points on the screen. How do i do that?
View 3 Replies
View Related
Oct 26, 2010
I have written the code for geocoding..but unfortunately it does not work ie nothing is displayed on screen...i am attaching the code...is the fault in the code..
CODE:.............
View 1 Replies
View Related
Dec 16, 2009
We are developing an application that requires a download of a music file (mp3). We are using the Browser Activity for the same.
The Browser Activity is invoked from the application and the download url is passed to it, like: startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(downloadurl)));
However, after downloading, on the download list page, if we press the Back button, a blank white screen is displayed. Only after we press the Back button a second time on this white screen, the application screen is displayed. This happens because the Browser Activity view is displayed before the actual downloading starts.
This is an issue in the application flow. We need to manage the flow in such a way that the 'Back' key press on the download list view will take the control to the application screen instead of the white screen.
View 3 Replies
View Related
Feb 15, 2010
Today I am looking for a way to mimic the behavior I know from my HTC Hero's lock screen: the calendar and alarm clock can put text & drawables there to inform about an upcoming event or an expired alarm. The lock screen remains there in that it must be dragged down to dismiss the shown event and there might also be a Snooze button.
But, first question: is this default Android stuff or HTC Sense specific only??
Second question: If it is a common Android thing, why can't I find anything in Google's Android documentation for the topics "lockscreen" or "lock screen" that comes close to my question? Where's the API for it?
My problem is: I want to inform the user immediately - even if I try a standard notification, the user with a locked screen will have to unlock it and drag down the notifications list to see & clear what's going on. sigh Putting an endlessly playing notification sound there is a hassle as it takes at least two swipes down to stop the sound playing!
View 2 Replies
View Related
Jan 19, 2010
As known, when using the setContentView() method, a view can be displayed on screen.
My question is whether there is a way to receive an event when the view is actually displayed on screen (since it takes some time for the view actually being displayed after the setContentView() method has been called).
View 2 Replies
View Related
Jun 9, 2009
I want to open the virtual keypad without touching a text view . Can someone help me how to open a soft keyboard and associate it with a textview already displayed on the screen?
View 2 Replies
View Related
Aug 21, 2009
when I click on launcher it does not show displayed activity log for launcher, it shows it way before during boot up stage. why is this happening?
View 2 Replies
View Related
Apr 26, 2010
How can I temporarily block all user interactions with the views of an activity ?(Other than calling the setEnabled method on each view)
View 2 Replies
View Related
Sep 2, 2010
I have an application that must create a database and if that fails, then no sense moving forward. I've built an AlertDialog and show() it but it never displays. The logic falls through and then barfs because of the missing database.What is the right/best way to throw up a message and halt the activity? The code below executes fine (meaning the show() occurs while debugging and it falls to the next line) but the UI never displays this alert.BTW I realize the throw might not be the most graceful but I'm not even getting that far so.
View 2 Replies
View Related
Jun 18, 2010
On my home screen where the weather is suppose to display all it says is Location. How can I fix this, or link me to an article that does?
View 4 Replies
View Related
May 20, 2010
Not sure of this has been asked but is there a way to change what screen is displayed while the DI is charging?
View 5 Replies
View Related
Mar 15, 2010
Is there a way, app or otherwise, to keep the dialer pad on the screen.
It becomes a pain in the butt when I have to use it for choosing options in a call menu.
View 4 Replies
View Related
Nov 20, 2010
How can I disable the keyguard when a broadcast receiver is activated by screen_on, so that when it occurs the user sees an activity that I have started behind it?(The activity is running already)I have been trying the following code from a broadcast receiver triggered by screen off.It doesn't seem to be working though as it is. When I turn the screen on, I still have to manually unlock the keyguard on the phone to reveal the activity behind it.
View 1 Replies
View Related
Feb 5, 2010
Can you please tell me how can my activity detect user pressing HOME key?
View 2 Replies
View Related
Oct 19, 2010
Is there a way to reprompt the user to choose a default activity for an intent? For example, user selects his default home apk and I want him to reconsider his choice once again. I know how to do that on 2.1 and before, but is there a way to do that now on 2.2? Famous Home Switcher, which did similar thing, does not work on 2.2 anymore thanks to google team.
View 1 Replies
View Related
Sep 27, 2010
I want to call another activity when the user clicks an hyperlink. Can anybody suggest me how to use Intent in this case?
View 6 Replies
View Related
Jun 28, 2010
I would like to launch an intent when any of my activity is visible, otherwise I will put it up as a notification, and will be fired by the user. To decide this, I need to know if any of my activity is front-most, how do I that?
View 3 Replies
View Related