android-4.0-ice-cream-sandwich

Why this doesn't work for ICS [duplicate]

你离开我真会死。 提交于 2019-12-20 06:43:43
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: Strange NetworkOnMainThreadException in Android app? Trying To Upload To Dropbox: NetworkOnMainThreadException? I have used the below code for reading HTML contents from a url. This works perfectly for 2.3.3 but when I try to run the same code it doesn't work for ICS. I am trying to append these html contents on to a edittext . But it always remains empty when I run the code on ICS. What may be the problem?

gralloc_goldfish(634): Emulator without GPU emulation detected

风流意气都作罢 提交于 2019-12-20 03:43:18
问题 I am using android SDK 4.0.3 and I'm trying to run a simple program in which I'm trying to switch from one page to another page using an Intent (By passing intent object as: Intent intent = new Intent(getApplicationContext(),SecondActivity.class); startActivity(intent); ) [Also, I have 3GB RAM] but when I run the program it gives something like this in DDMS: 01-23 01:58:23.892: D/gralloc_goldfish(634): Emulator without GPU emulation detected. 01-23 01:58:45.482: D/AndroidRuntime(634):

How to remove the border for Share button in Action Bar?

霸气de小男生 提交于 2019-12-20 03:24:15
问题 Have a look at the picture This is how Share button looks like in action bar. Here's the code I use in menu xml file: <item android:id="@+id/menu_item_share" android:showAsAction="ifRoom" android:title="Share" android:actionProviderClass= "android.widget.ShareActionProvider" /> Is it possible to remove that border or change its color? 回答1: You need to use custom background. This might help: https://developer.android.com/training/basics/actionbar/styling.html 回答2: Here is a more complet

Cannot receive broadcast in ICS

只谈情不闲聊 提交于 2019-12-19 21:17:10
问题 I writing 1 app for Android 4.0, and it's started via broadcastreceiver. My code is below: In AndroidManifest.xml: <uses-permission android:name="android.permission.INTERNET" /> <application android:icon="@drawable/icon" android:label="@string/app_name"> <receiver android:name="com.Android.Exercise.StartUpReceiver" android:permission="android.permission.RECEIVE_BOOT_COMPLETED"> <intent-filter> <action android:name="android.intent.action.BOOT_COMPLETED"/> <!--<action android:name=

android - show menu button on galaxy nexus

邮差的信 提交于 2019-12-18 16:55:22
问题 i need to have the menu button shown for some activities on galaxy nexus . i can't find how to do that, since it hides it by default . i don't wish to create an action bar since it takes more space that i want to use to other things . when setting the "android:targetSdkVersion" value to lower than 14 , it seems to show the menu button , but otherwise, it hides it . btw, the activity needs to be full screen , with no title/action bars . it is very weird that this button is not shown by default

Disable screenshots in android ics

谁说我不能喝 提交于 2019-12-18 11:42:59
问题 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 回答1: 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. 回答2: This will never be possible, period end of

Intent.ACTION_USER_PRESENT not received on HoneyComb or ICS (Samsung) devices

对着背影说爱祢 提交于 2019-12-18 08:29:28
问题 I have a BackgroundReceiver set up to receive the android.intent.action.USER_PRESENT in the manifest file as per: <receiver android:name="com.demo.MyBroadcastReceiver"> <intent-filter> <action android:name="android.intent.action.USER_PRESENT" /> </intent-filter> </receiver> My overridden onReceive(Context, Intent) method is very simple: @Override public void onReceive(Context context, Intent intent) { if (intent != null) { if (Intent.ACTION_USER_PRESENT.equals(intent.getAction()) { // wrapper

BroadcastReceivers in ICS

守給你的承諾、 提交于 2019-12-18 08:29:20
问题 I had written a small utility app just for my phone, which stopped the annoying carrier provided jingle which played on boot up. I noticed the sound didn't play if I put the phone into silent mode before powering off, so I wrote this little utility to go silent on power down and restore sound on boot. This worked well for a Galaxy S2 on Gingerbread. The entire code is in two classes: public class OnShutDownReceiver extends BroadcastReceiver { @Override public void onReceive(Context context,

Embedded Google Map can't get current location in WebView

我们两清 提交于 2019-12-18 05:01:32
问题 I followed this tutorial: http://android-er.blogspot.com/2013/03/embed-google-map-in-webview.html I'm trying to just use the Google Map in the WebView, but it can't get my current location. I've enabled JavaScript on the WebView. What else do I have to enable? Does anyone know why that might be? Shouldn't it prompt me to use my current location? Note that I am not interested in using a MapView as an alternative whatsoever. I'm trying to find out what I need to set on the WebView or maybe on

Embedded Google Map can't get current location in WebView

时间秒杀一切 提交于 2019-12-18 05:01:10
问题 I followed this tutorial: http://android-er.blogspot.com/2013/03/embed-google-map-in-webview.html I'm trying to just use the Google Map in the WebView, but it can't get my current location. I've enabled JavaScript on the WebView. What else do I have to enable? Does anyone know why that might be? Shouldn't it prompt me to use my current location? Note that I am not interested in using a MapView as an alternative whatsoever. I'm trying to find out what I need to set on the WebView or maybe on