Hi all!
I have a problem when develop Android application. I want to allow user change application's background at run-time (it looks like the way we change desktop background on PC). User can select a picture that they like (via file browser) to set background. I don't know how to do that. Help me please.
Thanks for reading.
YOu should check stackoverflow.com . It is the official android support for developers.
Here is a similar question: http://stackoverflow.com/questions/2482848/how-to-change-current-theme-at-runtime-in-android
Basically you will need to create a style indicating the background to use. And in runtime you should be able to get a value from the user preferences and set the them of the activity accordingly, using setTheme in onCreate (before calling setContentView). AFAIK you will have to do this in all your activities, there's no simple way to do it for all your application, unless it is before runtime.
Related
Hi all,
My app has one static control (text label) and one edit box in a child dialog (all of them are define by resource editor). This dialog has a bitmap background and I'm trying to make transparent background for static and edit controls.
I've tried to "google" but unsuccessful, all is about MFC. I have a small source file containing WndProc function for the dialog. How can I do that by adding some code in there?
Someone pls help me? Does the simplest and fastest solution exist? Give me some instruction by code or links pls? Thank you very much!
as far as I remember you cannot make transparent static/edit boxes easily. You should make them ownerdraw controls and paint the background yourself.
I knew the way of manual painting ownerdraw button and listbox but I thought ownerdraw other controls is impossible (there is no this exStyle for that).
OK, thanks for your help. I'll try.
hi,
not sure if this is possible, in .Net there is paging for a data grid,
can we do the same thing for a ListView/GridView in android? what i
want to do is to have either of the following:
1) in the view i want to have an image, a line of text, and then
programmatically switch to the "next page" with a different image and
line of text.
2) in the GridView/ListView, each item will contain an image and line
of text. at a certain time interval, i want to programmatically
highlight the next item (kind of like scrolling down)
the time interval will be determined by a timer. can someone help me?
Hi guys
I'm quite new at android developing and i'm really just playing around making things for myself
Right now i'm making an app with a settings menu that the user can set a variety of options.
One thing i really don't understand and i'm guessing i'm missing something basic here that everyone knows is how to create these menus
The type of menus i'm talking about can be found if you open the Internet got Menu > More > Settings
The menu style that you get is a standard one that can be found in heaps of applications however i can't seem to be able to google myself to how you create these
Thanks
Scott.
There is a subclass of the activity class called PreferenceActivity. Use it mostly as you would a regular activity class, but you can add predefined preference panels to the view. See the sample here:
http://developer.android.com/resour...ple/android/apis/app/PreferencesFromCode.html
I have designed a new menu for my app, that i think is more appealing than the regular android "six pack" menu and as such uses none of the menu xml attributes and is purely designed in the java and layout file.
However one of the options requires a list, and instead of bringing up an entire new activity, i would still like to use the sub menu list type, is it possible to do this from a onClick case? if not can anyone suggest an alternative way to get a similar result?
all help is much appreciated thanks
Android JB. I want to listen some events like onKeyDown in background (when activity is not visible). It must work with root or not, doesn't matter. How to do that?
For onKeyDown it is not possible
http://stackoverflow.com/questions/3454710/onkeydown-in-a-service-global-hot-keys/3455094#3455094
Yes it is possible through AccessibilityService. Sorry I can't paste URL for you because I'm a new user. Try to Google "AccessibilityEvent" and
"TYPE_VIEW_TEXT_CHANGED."
However, you'd need the user to enable the service in the setting manually. You can't programmatically enable accessibility service. Hope this helps you.