Android :: How To Detect If Widget Is On / Off Screen?
Sep 28, 2010
I'm writing a customized view similar to Grid which will be used to hold a large amount of images. I'm using ImageButton to display the images, and I only want to load images onto the buttons once they are on the screen (and just display a static background image when they are not). The reason for it is that I'm fetching images from some back-end service and I only want to fetch them when the buttons are on the screen.To do that, I'd like to know if the widget is on the screen. Is it possible to detect if a widget like button is on/off screen? If not, any suggestions on how to achieve what I'm trying to do?
View 1 Replies
Mar 15, 2010
I am writing a home screen widget and want to update (modify) the home screen widget when the device orientation changes from portrait to landscape or the other way. How can I make it? Currently, I tried to register to CONFIGURATION_CHANGED action like the code below ...
View 3 Replies
View Related
Oct 2, 2009
I'm trying to make widget gallery at homescreen. I'm currently stuck because didn't find any example how to detect on touch in widget. Could someone help me?
View 5 Replies
View Related
Mar 18, 2009
how can I detect Fling action in my own widget? I have implemented my widget as OnGestureListener.
And like in Gallery, I have a "GestureDetector mGestureDetector = new GestureDetector(this);"
For my onTouchEvent(), I have @Override public boolean onTouchEvent(MotionEvent event) {
// Give everything to the gesture detector boolean retValue = mGestureDetector.onTouchEvent(event); return retValue;
But my public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) is never get claeed.
View 3 Replies
View Related
Aug 13, 2010
What's the best way to detect when a Home Screen Widget has gained or lost focus? An example of losing focus is if the user navigates to another screen or if another screen popped up in front of the Widget.
View 1 Replies
View Related
Nov 6, 2009
how to detect the Widget in home screen is active in the current panel? As you know, some device has many panel i.e (HTC Hero has 7 panel), each panel can put some widgets on the home screen, then the widget will run and refresh the data automatically, we want to let the widget disable the refresh data feature while it is not under current panel. and enable it while it is put to current panel again.
View 7 Replies
View Related
Aug 6, 2009
It would appear on a G1 (with the latest software update) that onUpdate () runs even when the widget is not visible. Is there a way of sensing that the widget is or is not visible or is otherwise in foreground? That is, running the code below shows a logcat message at whatever interval the Widget is scheduled to update, whether it's in foreground or not, whether even the screen is dim or otherwise in deep sleep. It would seem onUpdate should only be scheduled to run when the Widget is in the foreground or visible. Is this a defect in the G1, or is there some other API call to detect if the Widget is visible?
public class HomeScreenWidget extends AppWidgetProvider { ...
View 2 Replies
View Related
Aug 2, 2010
I am looking for a way in which I can detect any tap on the screen (not just in my app), I don't mind not having the information of what the tap was (control/letter), just the fact that a tap was made will suffice for me for now. Is there any possible way to achieve this?
View 4 Replies
View Related
Apr 4, 2010
As mentioned in a previous question, I am having difficulty intercepting all android.intent.action.SCREEN_ON events without a long-lived service (discouraged). I may be able to work around the need if I can simply work out when the screen is on at any given time, in the service.
View 3 Replies
View Related
Mar 29, 2010
How can I detect the screen is on or off?
View 3 Replies
View Related
Jul 31, 2010
I am trying to detect Screen backlight On / Off.
I've found android.intent.action.SCREEN_OFF related its event.
But I don't know how to use this.
Can you suggest me about how to detect screen backlight on / off ?
I missing some example or sample code.
View 2 Replies
View Related
Apr 18, 2010
I recently bought a HTC Desire which I've become exceedingly fond of.I've read (and been told by a colleague who owns a HTC Legend) that wifi should automatically turn off while the screen is off to conserve battery. I have the impression that I should be able to see the wifi icon turn on as I turn on the screen and unlock the phone. However, I haven't noticed that happening: The icon seems to just be on always.I have then tried observing my router's DHCP table when the the screen is off, but I haven't observed the entry for my phone disappearing (and I don't really know how much time has to pass before the table not showing my phone.Are there any settings that can cause this behaviour? What about programs? I current use smart monitor to log data usage as well as locale (using a SSID plugin and not the locale "location" condition). The only services I can see apart from those I think are OS services, are the ones for locale, smart monitor lite and the SSID plugin.
View 5 Replies
View Related
Mar 19, 2009
How do I get the current screen resolution (width and height)?
View 10 Replies
View Related
Jan 3, 2010
I have a motion listener to detect finger down, finger drag, and finger up. I start my action at finger down and finish my action at finger up. When the action is finished, I store it in a stack for allowing undo. My problem is that if I don't get a finger up event, I can't finish my action to add it to the stack for undo.
How can I detect that the user's finger has left the screen?
I tried using the emulator to see if getEdgeFlags() ever returned anything useful, and the result was always 0.
Basically, if a finger leaves the screen, then nothing is touching the screen anymore and I would like to detect that as a finger up event. How can I do this?
View 3 Replies
View Related
Jul 27, 2010
I've got an onTouchEvent boolean on a Surfaceview, I've got openGL objects drawn on the view and I'm wondering is there anyway to detect where on the screen the onTouch happened? e.g (x,y) co-ordinates.
View 1 Replies
View Related
Nov 27, 2009
Is there any way where I can detect that the screen is about to turn off, so I can do some work *before* it happens?I need this to work around bug 3755: OpenGL apps sometimes crash when the screen gets turned off because they don't get surfaceDestroyed /surfaceCreated() events. Simply put, I need to shut down OpenGL before the phone has a chance to detach the GPU. The only events I seems to be getting when the screen turns off are onPause() and onWindowFocusChanged both of which turn up *after* the GPU detaches, by which time it's too late.
View 7 Replies
View Related
Jan 14, 2010
I've checked the WallpaperService.Engine class and don't see anything.What's the best practice for detecting home screen sliding?
View 3 Replies
View Related
Aug 26, 2010
I have an application that has many screens. Is it possible to detect if the screen NOT belonging to the application (not defined in my android manifest) comes into visibility?
View 1 Replies
View Related
May 9, 2010
I'm currently implementing a live wallpaper. This is also visible, when the device is locked. Now I want to show different content, when it is locked but can't find a way to detect this. PowerManager can only change the settings and the wallpaperEngine only gives me a general onVisibiltyChanged() method, which triggers every time you return to the home screen.Dos anybody know a way to detect if the device is locked?
View 2 Replies
View Related
Feb 15, 2010
Is there a way, some API one can call to detect if the user has set a screen unlock pattern or not?
View 2 Replies
View Related
Aug 20, 2009
Is there any way for a backfround task to programmatically detect or recognize by learned id which application or screen (different package) is showing?
View 5 Replies
View Related
Jun 3, 2009
I need to set different content view after rotating device screen. Is there any method to detect the direction of current screen is vertical or horizontal?
View 6 Replies
View Related
Aug 10, 2010
Is there a way to detect when a user unlocks the phone? I know about ACTION_SCREEN_ON and ACTION_SCREEN_OFF, but these seem to be fired when the screen switches on/off on pressing the power button, but not actually when the phone gets unlocked on pressing the Menu button...
View 2 Replies
View Related
Oct 20, 2010
In Javascript/jQuery, how can I detect if the client device has a mouse?
I've got a site that slides up a little info panel when the user hovers their mouse over an item. I'm using jQuery.hoverIntent to detect the hover, but this obviously doesn't work on touchscreen devices like iPhone/iPad/Android. So on those devices I'd like to revert to tap to show the info panel.
View 4 Replies
View Related
Mar 31, 2010
I am designing a home screen widget. I ran this widget on a HTC Hero device, which has a screen of 320 pixels * 480 pixels with mdpi. It ran perfect on HTC Hero. The widget takes 3 cells * 2 cells space, i.e. 240 pixels * 200 pixels.Then I ran this widget on a Nexus One device, which has a screen of 480 pixels * 800 pixels, mdpi. Since Nexus One also is mdpi, so I though 240dip is equivalent to 240 pixels on Nexus One and 200dip is equivalent to 200 pixels on Nexus One, so the widget will not take 3 cells * 2 cells space on Nexus One device. To my surprise, when running on Nexus One device, the widget take exact 3 cells * 2 cells, about 360 pixels * 300 pixels, on Nexus One device.I am confused. The layout xml above specifies 240dip in width and 200dip in height for the widget, but why did it take 360 pixels * 300 pixels on Nexus One Device? What am I missing?
View 2 Replies
View Related
Dec 6, 2009
I am trying to detect if the screen size is normal, large or small. I am using
Configuration conf =view.getResources().getConfiguration();
(conf.screenLayout&Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_NORMAL
When testing with the emulator this works for screen sizes normal and small, but large (480x800 & 480x854) returns that it is normal...
I have found very little information on using the configuration to detect the group, has anyone got any experience with this?
View 3 Replies
View Related
Dec 3, 2012
I was using my phone (droid 3) and the app I was using force closed, my phone lagged for a few seconds and then I just put it down so it could catch up. While waiting the screen timed out and when I went to use it I could not unlock it. I can press the button on top and it will turn the screen on or off, and if I hold it it will bring up the power off menu. I tried to call it, and it went through. I got the normal screen to answer it, but I could not answer it. After I hung up I got the notification for a missed call. Everything seems to be working, my screen just does not respond to a touch. What should I do?
View 4 Replies
View Related
Nov 18, 2010
I've an ImageView in a LinearLayout, how can I detect when user drag his finger from any place in the screen to inside of ImageView?
View 1 Replies
View Related
Mar 12, 2013
I'm coding a service which does a its job once in every 10 minutes. Works fine. However, when a screen lock gets activated, the service is stopped (which is normal I've found out and I'm find with that). But when the screeen is unlocked again, the 10-minute interval could be already over and I want the service to do the job immediatelly. But... how can I detect that the service was awaken? I schedule the tasks with handler.postAtTime() method.
View 3 Replies
View Related
Jul 12, 2013
I am trying to create a broadcast receiver to detect when the screen was locked. I have it already working to detect when the the tablet was booted, but it won't work for the SCREEN_OFF action. Right now I just have it log any intents that where triggered and so far its only working for when the boot was completed.
Code:
package com.atlantis;
import android.content.BroadcastReceiver;
import android.content.Context;
[code]...
View 1 Replies
View Related