android-4.2-jelly-bean

Changing the Vibrate settings in Jelly Bean, Android

烂漫一生 提交于 2019-12-04 17:18:59
I am looking for how we change the vibrate settings in Jelly Bean. I found that all the pre-JB vibrate settings have been deprecated, but don't see any new AudioManager.[change the vibrate settings] code anywhere. There is a setting "Vibrate when ringing" which I would like to know how to play with. Thanks for you help. house In android4.1 you can use this to control "vibrate & ringing" Settings.System.putInt(mContentResolver, Settings.System.VIBRATE_WHEN_RINGING, enable ? 1 : 0); From the Documentation: This method is deprecated. Applications should maintain their own vibrate policy based on

WiFi Direct on Android not working properly

那年仲夏 提交于 2019-12-04 13:08:51
问题 I am trying to develop an app using wifi direct in android Jelly Bean 4.1.1. If p2p is enabled I immedialtely call mManager.discoverPeers(mChannel, actionListener); After that I am getting a call back to the onPeersAvailable(WifiP2pDeviceList) I am testing with 2 Samsung(Google) Nexus device and wifi direct is turned on on both. But this call back is returning an empty list of peers. But for instance if I click on the Search Peers button on the default wifi direct interface immedialtely the

Hiding the Status Bar under Android 4.2.2 (SDK 17)

混江龙づ霸主 提交于 2019-12-04 12:34:26
Is it possible to permanently hide Navigation/Status Bar under Android 4.2.2 This solution seems not working under Jelly Bean. I have GalaxyTab 3 (10.1) and hidding of Status Bar has no effect. It's hidden on application Start on every screens, but i can expand it. Problem occurs also after rooting device. Somebody has faced it before (there is also video how to fix it): forum.xda-developers.com/showthread.php?p=37466852 So my question is: Is there any way to do this on application level? No, it seems like there is no way to do this for your entire application on tablets running 4.+. Also,

Android - Show/Hide system bar on 4.2.2 (Nexus 10)

邮差的信 提交于 2019-12-04 10:05:28
问题 I got issue with Nexus 10 - 4.2.2. I was testing code below on Galaxy Tab 10.1 with 4.0.4 and it was working fine: try { Process proc = Runtime.getRuntime().exec(new String[]{"sh","startservice","-n","com.android.systemui/.SystemUIService"}); proc.waitFor(); } catch (Exception e) { e.printStackTrace(); } try { //REQUIRES ROOT Process proc = Runtime.getRuntime().exec(new String[]{"su","-c","service call activity 42 s16 com.android.systemui"}); //WAS 79 proc.waitFor(); } catch(Exception ex) { /

Issue with Sharedpreferences in kitkat version in android

房东的猫 提交于 2019-12-04 06:42:33
问题 Hi in my application I am accepting pass code from user and storing it in shared preferences. And, I have provided pass code on/off functionality. If user checked on , app will ask user to enter pass code at the time of launch every time and will be off on checked of Off button. Everything is working fine on android's ICS, Jellybean version and below. But it never works on Kitkat. Unfortunately, I don't have a Kitkat device to debug my app. Below is the my code I am using for shared

Android 4.2 with 4 MediaPlayers = “Can't play this video”

我与影子孤独终老i 提交于 2019-12-04 01:07:39
问题 Whenever I'm trying to load at least 4 mediaPlayers, one of them will corrupt the video it's trying to load and trigger an Android OS message "Can't play this video" Other information: For 3 mediaPlayers everything works fine. On other Android versions, different from 4.2, the same code with the same 4 video works. The 4 video can be played independently on the device. There is no format problem. After starting the program and getting the "Can't play this video" message, the video can no

onCreateOptionsMenu called after onResume on JB 4.2

谁说我不能喝 提交于 2019-12-03 23:50:47
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 void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { inflater.inflate(R.menu.refresh_menu, menu);

onEditorAction() is not called after Enter key has been pressed on Jelly Bean emulator

南楼画角 提交于 2019-12-03 14:55:10
问题 I'm having a problem with the behavior of the latest Jelly Bean emulator. I have several EditTexts in my app. An OnEditorActionListener provides special handling when a user presses the ENTER key on the keyboard. This worked up until ICS, but now on Jelly Bean the listener callback method onEditorAction() no longer gets called. Only a new line is inserted into the EditText . This can be reproduced this way: EditText testEditText = new EditText(context); testEditText.setOnEditorActionListener

WiFi-Direct on JellyBean, WPA Supplicant messed up

青春壹個敷衍的年華 提交于 2019-12-03 13:42:48
问题 so a couple of months ago I've started developing some WiFi-Direct applications. A few days ago, I updated both of my Galaxy Nexus to Jelly Bean (4.1.x) and tested my applications, but it seems like there's something messed up again.. It was already a pain in the ass to get the main functionality set up on ICS, but now it does not work anymore. All i get is something like this in my logcat: /wpa_supplicant( 392): p2p0: P2P-PROV-DISC-PBC-REQ a2:0b:ba:xy:zz:xx p2p_dev_addr=a2:0b:ba:xy:zz:xx pri

Android - Mobile network settings menu (Jelly Bean)

社会主义新天地 提交于 2019-12-03 13:07:42
following code is not working for Jelly Bean (Android 4.1): final ComponentName cn = new ComponentName("com.android.phone","com.android.phone.Settings"); final Intent intent=new Intent(Settings.ACTION_DATA_ROAMING_SETTINGS); intent.addCategory(Intent.CATEGORY_LAUNCHER); intent.setComponent(cn); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(intent); Instead to start setting , it doesn´t nothing, any idea how to solve it? Here is solution: final ComponentName cn = new ComponentName("com.android.phone","com.android.phone.MobileNetworkSettings"); final Intent intent = new Intent