What are the default color values for the Holo theme on Android 4.0?

If you want the default colors of Android ICS, you just have to go to your Android SDK and look for this path: platforms\android-15\data\res\values\colors.xml. Here you go: <!– For holo theme –> <drawable name=”screen_background_holo_light”>#fff3f3f3</drawable> <drawable name=”screen_background_holo_dark”>#ff000000</drawable> <color name=”background_holo_dark”>#ff000000</color> <color name=”background_holo_light”>#fff3f3f3</color> <color name=”bright_foreground_holo_dark”>@android:color/background_holo_light</color> <color name=”bright_foreground_holo_light”>@android:color/background_holo_dark</color> <color name=”bright_foreground_disabled_holo_dark”>#ff4c4c4c</color> <color name=”bright_foreground_disabled_holo_light”>#ffb2b2b2</color> <color name=”bright_foreground_inverse_holo_dark”>@android:color/bright_foreground_holo_light</color> <color name=”bright_foreground_inverse_holo_light”>@android:color/bright_foreground_holo_dark</color> <color name=”dim_foreground_holo_dark”>#bebebe</color> <color … Read more

Android 4.0: widgets not appearing?

So here’s the solution I came up with: You need an activity that will appear on the launcher. So first we have ye olde widget receiver, like so: <receiver android:name=”.VolumeProfilesWidget” android:label=”@string/app_name”> <intent-filter> <action android:name=”android.appwidget.action.APPWIDGET_UPDATE” /> <!– Broadcast Receiver that will also process our self created action –> <action android:name=”net.thepurge.volumeprofiles.plus.VolumeProfilesWidget.ACTION_WIDGET_RECEIVER”/> </intent-filter> <meta-data android:name=”android.appwidget.provider” android:resource=”@xml/volumeprofiles_widget_provider” /> </receiver> … Read more

Easy way to hide system bar on Android ICS

After a lot of searching on the internet, I managed to get the System Bar to hide and appear in a 4.2 device using: To Hide: Runtime.getRuntime().exec(“service call activity 42 s16 com.android.systemui”); Or use 79 instead of 42 for API less than 14. You may also need to include the SET_DEBUG_APP permission, in which case … Read more

TYPE_SYSTEM_OVERLAY in ICS

To create an overlay view, when setting up the LayoutParams DON’T set the type to TYPE_SYSTEM_OVERLAY. Instead set it to TYPE_PHONE. Use the following flags: FLAG_NOT_TOUCH_MODAL FLAG_WATCH_OUTSIDE_TOUCH FLAG_NOT_TOUCH_MODAL << I found this one to be quite important. Without it, focus is given to the overlay and soft-key (home, menu, etc.) presses are not passed to … Read more

Hide ICS back home task switcher buttons

pinxue is spot-on… you want SYSTEM_UI_FLAG_HIDE_NAVIGATION. Example: myView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION); One thing to note, though, is that upon any (and I mean ANY) user interaction the navigation bar will be reshown. With Honeycomb the closest you can get is to go into “lights out” mode (now called “low profile”… SYSTEM_UI_FLAG_LOW_PROFILE ). This just makes the items on … Read more

SearchView’s OnCloseListener doesn’t work

I also meet this problem, and I have no choice but give up “oncloselistener”. Instead, you can get your menuItem, then setOnActionExpandListener. Then override unimplents methods. @Override public boolean onMenuItemActionExpand(MenuItem item) { // TODO Auto-generated method stub Log.d(“*******”,”onMenuItemActionExpand”); return true; } @Override public boolean onMenuItemActionCollapse(MenuItem item) { //do what you want to when close the … Read more

Fragment onCreateView and onActivityCreated called twice

I was scratching my head about this for a while too, and since Dave’s explanation is a little hard to understand I’ll post my (apparently working) code: private class TabListener<T extends Fragment> implements ActionBar.TabListener { private Fragment mFragment; private Activity mActivity; private final String mTag; private final Class<T> mClass; public TabListener(Activity activity, String tag, Class<T> … Read more

tech