android-4.2-jelly-bean

Different AndroidManifest files for different API levels

℡╲_俬逩灬. 提交于 2019-12-23 15:37:06
问题 I am creating an app where I need to collect status bar notifications. Users are prompted to allow either my implementation of NotificationListenerService (API >= 18) or AccessibilityService (other devices) and they are redirected to settings screen. When I am on API < 18 the user is redirected to Accessibility settings screen, he allows the Accessibility service and everything is OK. However, when the user is on 18>=, even if the user is redirected to Notification settings he still can

app will not launch on device

送分小仙女□ 提交于 2019-12-23 13:24:13
问题 I'm a noob to Java, Eclipse and Android application development. I'm going through the Android app tutorial but can't seem to get the first lesson to launch on my device. After fixing a handful of issue preventing the project from compiling I was able to get it to run on an AVD. But have had no luck on a physical device. The following are the details of my environment and what the console shows me. On the phone I tried looking for the install under apps, downloads and the desktop but don't

Why doesn't Jelly Bean show the second row in a Notification?

[亡魂溺海] 提交于 2019-12-23 07:49:39
问题 I'm currently looking into the NotificationCompat features of the Android Support Package v4 Rev 10. The documentation says that 'setContentText()' shows the second row in a notification. This is true for API 8 up to API 15. However, if I try to use this method in API 16 my Notifications will miss the second line. I see only the Title but not the second line. Adding multiple lines is no problem (using 'addline()'). Here's my code for the NotificationCompat.Builder I used: private

On Android 4.2.2, Intent INSTALL_SHORTCUT creates shortcut in the second page

雨燕双飞 提交于 2019-12-23 05:44:33
问题 I get a strange result when calling this code to simply create a shortcut in the home screen. The shortcut is created on the second page of the home screen (and the first page is empty so there is enought space!). Any ideas? public static void installShortcut(Context context, String packageName, String componentName, String shortcutName, Parcelable icon) { Intent shortcut = new Intent("com.android.launcher.action.INSTALL_SHORTCUT"); ComponentName cn = new ComponentName(packageName,

Android 4.2 9-patch background drawn differently than older OS versions

十年热恋 提交于 2019-12-23 03:21:41
问题 I have a Nexus 7 with Android 4.2.1 and I noticed in my app the background image I am using for some linear layouts is drawn incorrectly. With other devices with older versions of the Android OS the 9-patch background is drawn correctly but with this device the border line is stretched when it should not be stretched. Correct (Evo 4G v2.3.5): http://i.imgur.com/WDTNr.png Incorrect (N7 v4.2.1): http://i.imgur.com/HntMY.png Any idea what is causing this? If not, is there any other way to get

Android 4.2 9-patch background drawn differently than older OS versions

帅比萌擦擦* 提交于 2019-12-23 03:21:30
问题 I have a Nexus 7 with Android 4.2.1 and I noticed in my app the background image I am using for some linear layouts is drawn incorrectly. With other devices with older versions of the Android OS the 9-patch background is drawn correctly but with this device the border line is stretched when it should not be stretched. Correct (Evo 4G v2.3.5): http://i.imgur.com/WDTNr.png Incorrect (N7 v4.2.1): http://i.imgur.com/HntMY.png Any idea what is causing this? If not, is there any other way to get

Galaxy s4 res folder

怎甘沉沦 提交于 2019-12-22 09:37:37
问题 Galaxy s4 Screen: 4.99", 1920x1080 (FullHD). Which the res folder would be used in FHD and what's the dpi value should be set? xhdpi or xxhdpi? And how can I calculate it? I didn't find any info in the developer docs and in the screens_support article 回答1: It's 441 dpi, isn't it? So almost certainly xxhdpi, which is already supported in the Android framework. But why worry about it at this time? Assuming you're already supporting xhdpi, the likelihood that the average user can detect the

onCreateOptionsMenu called after onResume on JB 4.2

情到浓时终转凉″ 提交于 2019-12-21 06:52:59
问题 I have the following fragment in my application: public class MyFragment extends SherlockListFragment implements LoaderManager.LoaderCallbacks<Cursor> { private MenuItem refresh = null; @Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); setHasOptionsMenu(true); //..... // NPE here refresh.setActionView(R.layout.indeterminate_progress_action); getActivity().getSupportLoaderManager().initLoader(0, null, this); } @Override public

Gamepad Support Android

蹲街弑〆低调 提交于 2019-12-21 05:21:45
问题 I am trying to add gamepad support to my game but I can't find anywhere how to get the motion events from a gamepad's joysticks. I have something like this but it never seems to get called or do anything. I am testing on a XOOM with JellyBean and my gamepad works for navigating around the menus. @Override public boolean onGenericMotionEvent(MotionEvent e) { if ((e.getDevice().getSources() & InputDevice.SOURCE_CLASS_JOYSTICK) != 0) { float x = e.getX(); float y = e.getY(); mJoy1.set(x, y);

Gamepad Support Android

假装没事ソ 提交于 2019-12-21 05:21:13
问题 I am trying to add gamepad support to my game but I can't find anywhere how to get the motion events from a gamepad's joysticks. I have something like this but it never seems to get called or do anything. I am testing on a XOOM with JellyBean and my gamepad works for navigating around the menus. @Override public boolean onGenericMotionEvent(MotionEvent e) { if ((e.getDevice().getSources() & InputDevice.SOURCE_CLASS_JOYSTICK) != 0) { float x = e.getX(); float y = e.getY(); mJoy1.set(x, y);