android-4.0-ice-cream-sandwich

Reading all of today's events using CalendarContract - Android 4.0+

旧街凉风 提交于 2019-11-30 07:13:34
问题 I'm trying to use Android's new calendar API to read all of today's calendar events. I'm have trouble finding the right selection on the database query to return all of the events. It seems that all recurring and all day events are left out of the selection. What selection args would permit me to obtain all of today's events from the calendar api? Here is my current attempt: Cursor cur = null; String selection = "((" + CalendarContract.Events.DTSTART + " >= ?) AND (" + CalendarContract.Events

Show black preview screen in task manager on ICS

≯℡__Kan透↙ 提交于 2019-11-30 05:28:47
问题 I want to show a black screen in the task manager preview under Ice Cream Sandwich, like the German 'finanzstatus' app does. It would be nice if someone could point me in the right direction. 回答1: Using FLAG_SECURE will block your app from screenshots, including the recent tasks list: public class FlagSecureTestActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); getWindow().setFlags(LayoutParams.FLAG_SECURE, LayoutParams

Disable screenshots in android ics

北城余情 提交于 2019-11-30 04:26:06
For one of our secure apps, there is a requirement to disable the screenshot capability for the app in Android ICS. Is this possible on a non-rooted device? Thanks, Rajath Android Why don't you add this line in your activity class. This will do the trick. // This disables screen shot to be taken for current activity getWindow().setFlags(LayoutParams.FLAG_SECURE, LayoutParams.FLAG_SECURE); You may want to have a look at Mark Murphy's blog post . This will never be possible, period end of story. Its also possible for the owner of the device to obtain any encryption keys used by your application

What is triggering this Exception instance: “java.lang.IllegalArgumentException: The observer is null.” and how could it be avoid?

元气小坏坏 提交于 2019-11-30 04:00:58
I'm getting this exception when returning to the original ListActivity after opening an new activity with the content of the item selected by the user. It only occurs on Ice Cream Sandwich. This is the trace: java.lang.IllegalArgumentException: The observer is null. at android.database.Observable.unregisterObserver(Observable.java:59) at android.widget.BaseAdapter.unregisterDataSetObserver(BaseAdapter.java:42) at android.widget.AbsListView.onDetachedFromWindow(AbsListView.java:2373) at android.view.View.dispatchDetachedFromWindow(View.java:9756) at android.view.ViewGroup

PACKAGE_ADDED BroadcastReceiver doesn't work

自闭症网瘾萝莉.ら 提交于 2019-11-30 03:58:58
I have a broadcast receiver registered in Manifest: <application ...> <receiver android:name="com.some.pkg.NewAppReceiver" > <intent-filter> <action android:name="android.intent.action.PACKAGE_ADDED" /> </intent-filter> </receiver> </appcication> And the receiver: public class NewAppReceiver extends BroadcastReceiver { private static final String TAG = "NewAppReceiver"; @Override public void onReceive(Context context, Intent intent) { Log.d(TAG, "Intent: " + intent.getAction()); } } And nothing is received when I install APK manually or from the Android Market . Why? Did you run the app that

How to change Android DatePicker Dialog's “Dividers” Colors

爷,独闯天下 提交于 2019-11-30 03:23:08
问题 I'm trying to create a custom dialog, basically I'm using DatePickerDialog.THEME_HOLO_DARK but I want to change the "divider" color and the text color. I want to change the blue lines and the text color to red. Thanks in advance! EDIT: Using this code: <style name="testo" parent="@android:style/Widget.DeviceDefault.DatePicker"> <item name="android:divider">@drawable/dialog_divider</item> </style> This is what I get: The drawable for the divider is basically a red line.. 回答1: You will have to

Android Actionbar items as three dots

不想你离开。 提交于 2019-11-30 03:18:36
I have a menu for my main activity (res/menu/main_menu.xml) and I want only one item on the Actionbar and the rest shall be hidden under three dots menu. The problem is, I never see the three dots item on my actionbar. Why I can't see three dots item? How to force items to be hidden under it? Note: I use minSdkVersion="14" and I test in AVD. <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"> <item android:id="@+id/menu_item_share" android:title="@string/share" android:icon="@android

Add contact intent doesn't return data onActivityResult under ICS

跟風遠走 提交于 2019-11-30 01:09:01
问题 I want my application to prompt the user to create a new contact, through the standard Contacts interface on Android. Then I want to be able to read the information back from the newly created contact. My code is based on the "Adding A New Contact" from this site. Intent intent = new Intent(Intent.ACTION_INSERT); intent.setType(Contacts.CONTENT_TYPE); intent.putExtra(ContactsContract.Intents.Insert.PHONE, number); startActivityForResult(intent, PICK_CONTACT); and then @Override protected void

SMS_RECEIVED not working on Ice Cream Sandwich?

好久不见. 提交于 2019-11-30 00:30:51
问题 I'm trying to use android.provider.Telephony.SMS_RECEIVED to catch incoming SMS's. I built a simple app, which works on 2.x, but when I try it on my 4.0 emulator or device, it doesn't work. Any ideas? Manifest: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.giggsey.MyFirstApp" android:versionCode="1" android:versionName="1.0"> <application android:icon="@drawable/ic_launcher" android:label="@string/app_name"> <receiver

Why won't the Android browser span this paragraph over the full browser width?

孤者浪人 提交于 2019-11-29 23:56:35
The Problem: The Question The paragraph will fill the complete width of the page in Firefox Firefox Mobile (tested with 4.0.3 on SGS2) Chrome Chrome Mobile Beta (tested with 4.0.3 on SGS2) Internet Explorer Internet Explorer Mobile (testes with Windows Phone Emulator) Opera Mobile (tested with 4.0.3 on SGS2) Android native browser (tested with 4.0.3 on SGS2 and Android emulator) What do I have to do so it does the same in the default Android browser? I tried: Please note that this example is reduced to show the problem which I have on a much larger page. So I would like the solution to be as