Android :: Method To Detect Widget Is Visible - Foreground Or Background?
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
Sep 21, 2009
When i ran my old application in 1.6 i noticed that the progress bar was not showing up on the screen.When i analyzed it further i found the issue.The progress bar is getting activated but its not visible since my background color is also white.When i changed the background color i was able to see the progress bar.Is there no other way to make the progress bar visible other than changing the background color..Shouldn't the progress bar be visible under all background colors??
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
Apr 28, 2009
I want to know is there a way one can check(programmatically) whether currently virtual keyboard is visible or not? I want to run some code when the keyboard is visible. Is there a even that occurs when the keyboard is being visible and when it goes back to hidden state?
View 7 Replies
View Related
Aug 21, 2010
I am currently writing my first Android application and I keep running into references to background and foreground services. Since I intend on using a service in my application I was hoping to get a clarification between the two and how they are used.
View 1 Replies
View Related
Sep 11, 2009
I cant find anywhere how to change the Text COLOR in a webview. I can change the background color but not the Text.
Any Ideas? I want my webview to be white text on a black background instead of black text on a white background.
View 2 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
Jul 26, 2010
I am developing an application that has to capture the key events both in foreground and in background. I used the following code. But am unable to capture the keys in background.
CODE:............
I used broadcast reciever..
CODE:.................
View 1 Replies
View Related
Jul 19, 2010
Is there any way to launch an activity w/ Intents (in this case the Browser) in the background, and then bring it to the foreground using a service or activity?
I know it's possible to bring apps to the foreground by launching an intent with FLAG_ACTIVITY_BROUGHT_TO_FRONT
But is it possible to initially launch the activity in the background?
View 3 Replies
View Related
Oct 19, 2009
In my application i wait on socket for network events.On some events i have to bring activity into foreground(make activity as running) if at all it is not in the foreground.
View 17 Replies
View Related
Feb 9, 2009
I have a subclass of android.app.Dialog and because I am using a light theme, the dialog title comes out as Black on a dark background which is hardly readable. This leads me to the question: how do I change the Dialog title background or foreground colors? Can I do this via a theme? Which property will it map to?
View 4 Replies
View Related
Aug 28, 2010
I would like to know what the best way would be to draw a background image (this would be pretty much static) and a foreground object which would move depending on user input in Android?
Sort of like a side-scroller game (when the foregroudn object needs to animate and change a lot more than the background).
View 1 Replies
View Related
Jan 30, 2010
I wish to have one application that runs in the background, which knows when any of the built-in applications (messaging, contacts, etc) is running. So my questions are: How I should run my application in the background. How my background application can know what the application currently running in the foreground is.
View 4 Replies
View Related
May 14, 2010
The default progress wheel on Android doesn't display well when the background is white, it's barely visible. How can I fix this?
View 3 Replies
View Related
Mar 10, 2010
I'm going to create widget which needs to update its content every minute (it shows time-related data).
However, there is no need to update widget if it is currently invisible, which means:
screen is turned off
another app is running
widget is placed on another (invisible) home screen tab
What is the best way to update only visible widget every minute - without waking up device nor doing unnecessary computations? After widget becomes visible, small lag before update is acceptable.
View 2 Replies
View Related
Aug 5, 2010
I need a way for my Activity to known that it's going into the background, and not when it's getting killed. I thought about hooking at onStop(), but onStop() is called for both cases. In other words, is there a way to tell if when my Activity is moving into the background and not getting killed?
View 2 Replies
View Related
Jan 14, 2010
I'm at the beginning of writing an AddWidget for the home-screens. From what I understand, these can only utilize RemoteViews ran by the home-process and not your own. Which means we won't be getting any callbacks, such as onDraw. Is there a way you can get knowledge of how often and for how long a widget is visible? The RemoteView API seems very simplistic, what am I missing?
View 2 Replies
View Related
Mar 3, 2010
I want to create an app or background service that just listens for the launch of a 'default' app, say Contacts or the built-in Gmail app. If the contact app is clicked, I want to transfer control to my app temporarily (e.g. present a Yes/No popup to the user or increment an internal counter of my app ) and then redirect the user back to the app that was clicked. I want to do this only for a couple of 'well-known' built-in default apps, not any third party apps..
View 3 Replies
View Related
Jul 23, 2010
The official documentation describes tasks as follows: All the activities in a task move together as a unit. The entire task (the entire activity stack) can be brought to the foreground or sent to the background. Suppose, for instance, that the current task has four activities in its stack three under the current activity. The user presses the HOME key, goes to the application launcher, and selects a new application (actually, a new task). The current task goes into the background and the root activity for the new task is displayed. Then, after a short period, the user goes back to the home screen and again selects the previous application (the previous task). That task, with all four activities in the stack, comes forward. Is there a way to programmatically detect when the task of the current Activity moves into and out of the background? I would like to know when the user has switched switched to another application, vs. when the user navigated to another Activity in the current app.
View 2 Replies
View Related
Aug 31, 2010
I want to call a method every X minutes, if my method got a result it ´should inform the user by vibrating or showing a alertbox. if the method doesn't get a result it should wait for X minutes and restart. What is important, this should also work when the phone turns to sleep. Which means I want to wake the phone from sleep to run my method. Actualy I can activate my method via a Button, and it is working like I want it to be except the background loop thing.
I already searching for a solution here in the group or also on google but I think I don't got the right search terms to find a solution for my problme. I already read about the AlarmManager and broadcast receiver but I'm not sure if this is right for my problem.
View 6 Replies
View Related
Oct 5, 2010
I have a Android with Lee Droid Froyo. Also is the standard messaging app along with Handcent SMS app. The first issue is that after I receive messages for a period of time (week or so) messages start coming in as MMS messages instead of SMS from a 5556 number, not the person who sent the SMS. I check the details and it states the incoming message is "SMS Message", however both stock message and handcent app handle and label as a MMS message from user 5556 but the message in the MMS is blank. When the messages arrive they are visible in the locked screen messages widget then disappear after entering the program to view them. I had the "delete old messages" unchecked and had a SMS message limit of 200. I have since checked the "delete old messages" and increased to 300 the SMS message limit but still have the same issue.
View 1 Replies
View Related
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
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
Mar 20, 2010
I recently upgraded my Android app to support multiple resolutions. Previously, my Android.manifest file had a line:
To support multiple density and resolution devices, I changed this to:
CODE:............
I then added a couple of new directories, like drawable-hdpi-v4 and drawable-long-hdpi-v4 that includes the high-res versions of the graphics. That's about it.
Ever since releasing this update, there have been a decent number of users complaining about various problems:
the app icon doesn't appear (I did not create a high res version of the icon)
the home screen widget no longer works, even if they delete and re-add it (this code did not change with the update). I've had a user send me their error log, which shows:
CODE:................
There is one questionable section in my existing widget code that may be relevant:
CODE:..........
And perhaps most troublesome: the sqlite database is no longer accessible/writeable for some users so their data is no longer available. I did add the WRITE_EXTERNAL_STORAGE permission to the manifest. This is only happening to certain users and it tends to be HTC Eris users. In that error log I see things such as:
CODE:.........
It's as if the update has caused a new process and it can't access the old process's data, or something.
View 1 Replies
View Related
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
Sep 1, 2010
I have a time out of 15 min but sometimes I know I won't be around and just want to enable the lockscreen on the spot. Is there a way to do this?
View 5 Replies
View Related
Jan 26, 2010
I have an app with a widget but I am having some difficulty with the layout of the widget. The basic idea if the widget should look like an icon and have a little text tag under it like any other icon on the desktop.
I found one example which uses an android:background for the TextView and uses a drawable XML:
CODE:...........
However this does not work brilliantly, the text just isn't the same as the other icons on the desktop and when you rotate the phone part of the text is chopped off!
The next problem is selecting the widget, I use an ImageButton as the icon - with the android:background set to a transparent image. I have been using another drawable xml file which allows me to change the image when the widget is selected. However I would prefer the default action of an icon, where the square around the icon turns orange.
How would I achive these two effect - I know it is possible somehow as the app "sms unread count" achives exactly what I want to happen!
View 1 Replies
View Related