I have problem with android widget(it shows battery state). If You have this widget on home screen and you will update it from android market there is a problem with working. Widget doesn't work until battery state will not change. I don't know how to fix it. Is there any function, which is started (after installation of new version ) in appwidgetprovider or service?
Sometimes you have to restart the program launcher to get a widget to update after installing it from Market.
Go to Settings → Apps → Running.
Choose "Launcher" (this may be named differently depending on your version of Android; you may also have to touch "Show Cached Processes" to see it).
Touch "Stop".
Now touch the Home button again, and go back to your widget chooser
(pre-Android 4.0, long-touch the home screen; Android 4.0+, touch
the application launcher button in the middle of the bar and select
the Widgets tab).
You should now see the widget. Add it to your home screen as normal.
Related
I have developed a custom launcher/homescreen and it has been working perfectly on all android version for nearly two years. So far this launcher has been used in various Samsung devices.
Currently I am testing it in new huawei lua-u22 device. My launcher runs, can be set as default and shows up other apps on top of launcher too. But if I run another app (for example Gmail), screen lock(Swipe only) for 20-30 second, unlock device then press back button then instead of bringing it back to my launcher it goes back to default huawei homescreen. I checked by going to the settings-> home and there my launcher was still set as default. It only brings back my launcher home screen when I press home button again.
Is this problem of huawei device that is always redrawing default huwaei home as homescreen? Is there anyway I can track default selected home change at any time?
I found out the reason. In huawei after screen is tuned off my app was getting killed.
Huawei has a feature Protected Apps which allows application that is enabled in the list to keep running when screen is turned off. After I allowed my app in Protected apps it was not getting killed after screen turned off and everything now working properly.
To enable this feature go to System settings (which you can either find in the quick toggles portion of the notification shade by pulling down the status bar on the top portion of the screen). Go to All tab, Scroll down to Privacy and Security section, go to to Protected Apps and enable your app(this will control what’s allowed to run when the screen is off and what isn’t)
In stackoverflow there are few codes available to run this screen pro-grammatically which I do not find reliable enough as it may change in any new version of device.
I am making one lock application and for that I need to disable home button. I already tried all the common solutions available and it works for other android versions but for this device which is running on Android 4.2.2 it fails always.
You can't disable the home button as it can cause security issues promoting malicious apps etc.
What you can do is add an overlay to your app instead that will cover over other apps.
See this link for more info:How to disable Home and other system buttons in Android?
Make application as launcher.
First time when home button is pressed, device ask for choose launcher, select your applicaiton with always options.
From the next time when application is opened and you press the home button app never go in background.
Is there any way to retrieve position/location of android widget which is activated in android device, like whether its on lock screen, home screen etc. In lock screen is it the main widget displayed.
On Android 2.1 and later, with some select home screens, you can find out where an app widget resides when it is clicked via getSourceBounds() -- this value is attached to any Intent you spawn via a PendingIntent via setOnClickPendingIntent().
However:
this only works on Android 2.1 and newer
not all home screens might do this, as this is part of the Launcher code IIRC
the coordinates are in pixels IIRC
there is no way to interrogate the home screen to find out this information any other way, since there is no API to interact with the home screen
Hence, I think your stated goal ("Depending on whether it's on the top of the desktop or at the bottom different layouts for the widget will be chosen") is impossible, I think.
In my app, there is a activity where it is important that the system UI buttons (home, back, etc.) are not pressed, though it is ok if they are still visible. I have heard that there might be a way to achieve this, at least in 4.0 (I'm using 4.2).
A way to quickly and automatically return to the app if the buttons are pressed is also a correct answer, but seems less plausible. Thanks.
This is possible to override the home button by making your activity as home activity i.e
-- category android:name="android.intent.category.HOME"
but in this case android give user option to choose the app on launcher dialog where if user choose your application and click always, he will not be able to go to homescreen until you specifically provide a exit button oinside your app and reset it which you should definately do.
I'm afraid I've never owned an android device and only have the emulator to work with.
I am building a widget (>= API 14) and would like to test it on the homescreen. However, I have no idea how to actually create my widget! A long press on the homescreen just shows the "Select wallpaper from" popup.
I can see it in the list when I use the Widget preview app but as part of my testing I want to test real functionality. How do I get the widget to appear on the homescreen?
How do I get the widget to appear on the homescreen?
Open your launcher. Keep swiping right-to-left to get to the app widgets. Long-press on an app widget to add it to the home screen.