android-4.2-jelly-bean

How to properly update a notification post api 11?

和自甴很熟 提交于 2019-12-02 21:44:40
Before Notification.Builder came into existence the way to update a notification that was already in the notification tray was to call setLatestEventInfo() and then send the notification back through the NotificationManager.notify() call with an ID that matches the first notify() call you made. Now setLatestEventInfo() is deprecated with the message: Use Notification.Builder instead. But I cannot find any documentation about how to properly update a notification using Notification.Builder . Are you just suppose to recreate a new Notification instance every time you need to update the

Android OS bug with some devices running Jelly Bean/4.2.1 - TextView.setError(CharSequence error) Missing icon

倖福魔咒の 提交于 2019-12-02 17:27:27
Some, but not all, devices running Jelly Bean (4.2.1) appear to be missing the exclamation point error icon that should appear on a TextView (or, more commonly, an EditText ) that has an error set on it via TextView.setError(CharSequence error) . The Galaxy Nexus definitely seems to be missing the icon. The effect is that the error status set by setError is only apparent when the EditText has focus. This makes setError(...) much less useful as it's often used to encourage users to return to that EditText to fix a problem. E.g., you have a standard login screen with username and password form

Issue with Sharedpreferences in kitkat version in android

你说的曾经没有我的故事 提交于 2019-12-02 11:45:47
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 preferences:- SharedPreferences sharedPreferences; //sharedPreferences = getActivity().getSharedPreferences(

View(Button) not getting visible when android:targetSdkVersion=“17” not specified in manifest.xml for Android 4.1.2 (Samsung Galaxy s2 gt-i9100)

≡放荡痞女 提交于 2019-12-02 11:43:24
问题 I have used Fragments and displaying a text animation in each fragment. Inside my Fragment activity I have taken a "next" button and have made it invisible. After the text animation is finished in a fragment, I am making the button visible and applying TranslateAnimation. When I test it on Samsung Galaxy s2 with Jelly Bean, the button is not getting visible on the first place. This happens when I remove the attribute, android:targetSdkVersion="17" from the manifest file. When I specify it

How to force Android to re-index all the photos on the phone?

天涯浪子 提交于 2019-12-02 07:39:24
问题 I noticed something odd with the way Galaxy Nexus handles photos and file directories. I create them but Android (4.2.2) does not know they exist until you reboot. Well at least on my Nexus 4. I am creating an app and when taking a photo and storing it in Pictures it does not show on Gallery or even show up on my file explorer when you connect your phone to the computer. But when using a file explorer on the phone it finds it. When I reboot my phone it also appears. Is this specific to stock

How to force Android to re-index all the photos on the phone?

左心房为你撑大大i 提交于 2019-12-02 06:19:45
I noticed something odd with the way Galaxy Nexus handles photos and file directories. I create them but Android (4.2.2) does not know they exist until you reboot. Well at least on my Nexus 4. I am creating an app and when taking a photo and storing it in Pictures it does not show on Gallery or even show up on my file explorer when you connect your phone to the computer. But when using a file explorer on the phone it finds it. When I reboot my phone it also appears. Is this specific to stock Android? I am making this assumption as it does not happen on my friend's Galaxy S3. So leading to my

Working Directory : null environment when running Process.Builder on android

痴心易碎 提交于 2019-12-02 04:51:48
I am using two phones, Galaxy Nexus(JellyBean) and Nexus 5(KitKat). I am trying to execute a script which exists in /data/folder/scripts/run.sh I use Process.Builder to build the command. This command is built by getting Environment.getDataDirectory().toString() + "/folder/scripts/run.sh" There are no issues running this on the Galaxy Nexus but when I run it on the Nexus 5, I catch an exception when I run the process.start(). The output which I get contains: Error running exec(). Command: [/data/folder/scripts/run.sh, "param"]. Working directory: null Environment: [ADNROID_ROOT=/system ... ]

issue in sending sms using smsManager.sendTextManager on android

青春壹個敷衍的年華 提交于 2019-12-02 01:44:55
i am sending an sms from my app to server which uses 5 digit mobile number. on 4.2.2 os, it ask me below popup Edited Q. How to handle cancel/ok button? This should work... switch (getResultCode()) { // if cancel pressed then result code is 5 case 5: System.out.println("Message cancelled........"); break; // else if send pressed then result code will be one of these below cases case Activity.RESULT_OK: break; case SmsManager.RESULT_ERROR_GENERIC_FAILURE: break; case SmsManager.RESULT_ERROR_NO_SERVICE: break; case SmsManager.RESULT_ERROR_NULL_PDU: break; case SmsManager.RESULT_ERROR_RADIO_OFF:

Make alert dialog background transparent

可紊 提交于 2019-12-02 01:33:37
问题 I am creating an alert dialog on Android Jelly Beans OS. Everything works well but what I want is that instead of the black background of the alert dialog I want a transparent background. I read so many articles and user's question on stackoverflow but none of them is helping me out. Here is my code: AlertDialog.Builder builder = new AlertDialog.Builder(this, R.style.CustomAlertDialog); builder.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() { public void onClick

Make alert dialog background transparent

蹲街弑〆低调 提交于 2019-12-01 20:40:07
I am creating an alert dialog on Android Jelly Beans OS. Everything works well but what I want is that instead of the black background of the alert dialog I want a transparent background. I read so many articles and user's question on stackoverflow but none of them is helping me out. Here is my code: AlertDialog.Builder builder = new AlertDialog.Builder(this, R.style.CustomAlertDialog); builder.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog1, int which) { gActivityResult = REQUEST_PICK_CONTACT; onResume(); return; } });