android-4.0-ice-cream-sandwich

INSTALL_FAILED_UPDATE_INCOMPATIBLE when I try to install compiled .apk on device

烂漫一生 提交于 2019-11-26 18:21:44
I've compiled Trebuchet launcher from CyanogenMod 9, and trying to install it with adb: $ adb install out/target/product/generic/system/app/Trebuchet.apk 3986 KB/s (7870141 bytes in 1.928s) pkg: /data/local/tmp/Trebuchet.apk Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE] I tried on Nexus S with CM9 and Galaxy Nexus with stock JB. Why I'm getting this error? EDIT: In my case I've tried to reinstall system package with package manager. That's not supported, so I've got this error. Source of the error may differ in your case. it means the application which you want to install is already installed.

Fragment onCreateView and onActivityCreated called twice

我只是一个虾纸丫 提交于 2019-11-26 18:21:22
I'm developing an app using Android 4.0 ICS and fragments. Consider this modified example from the ICS 4.0.3 (API level 15) API's demo example app: public class FragmentTabs extends Activity { private static final String TAG = FragmentTabs.class.getSimpleName(); @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); final ActionBar bar = getActionBar(); bar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS); bar.setDisplayOptions(0, ActionBar.DISPLAY_SHOW_TITLE); bar.addTab(bar.newTab() .setText("Simple") .setTabListener(new TabListener<SimpleFragment

how to turn speaker on/off programmatically in android 4.0

不问归期 提交于 2019-11-26 17:34:10
I play a file through media player and I want to give options like speaker on/off, play though headset, bluetooth ,etc. I tried the below code which works well for android 2.2 but I want something that can also work for 2.2 and 4.0 both. Can you help me to programmatically turn the speaker on/off and playing via headphones? AudioManager audioManager = (AudioManager)context.getSystemService(Context.AUDIO_SERVICE); if(isOn){ audioManager.setMode(AudioManager.MODE_IN_CALL); audioManager.setMode(AudioManager.MODE_NORMAL); }else{ //Seems that this back and forth somehow resets the audio channel

Determine addAction click for Android notifications

北城以北 提交于 2019-11-26 17:04:27
I'm trying to use the new notifications interface. I've added 3 buttons to the notifications, and I want to save something to my database once each of them is clicked. The notification itself works well and is shown when called, I just don't know how to capture each of the three different button clicks. I'm using a BroadcastReceiver to catch the clicks, but I don't know how to tell which button was clicked. This is the code of AddAction (I've excluded the rest of the notification, as its working well) - //Yes intent Intent yesReceive = new Intent(); yesReceive.setAction(CUSTOM_INTENT); Bundle

Android ICS 4.0 NDK NewStringUTF is crashing down the App

こ雲淡風輕ζ 提交于 2019-11-26 15:38:57
问题 I have a method in JNI C/C++ which takes jstring and returns back jstring some thing like as below, NATIVE_CALL(jstring, method)(JNIEnv * env, jobject obj, jstring filename) { // Get jstring into C string format. const char* cs = env->GetStringUTFChars (filename, NULL); char *file_path = new char [strlen (cs) + 1]; // +1 for null terminator sprintf (file_path, "%s", cs); env->ReleaseStringUTFChars (filename, cs); reason_code = INTERNAL_FAILURE; char* info = start_module(file_path); jstring

Is there a way to hide the system/navigation bar in Android ICS

一笑奈何 提交于 2019-11-26 15:28:26
问题 I'd like to extend the discussion regarding hiding of the system/navigation bar at the bottom of the screen on Android Ice Cream Sandwich (4.0 and up) tablet devices. There's already a thread ( Is there a way to hide the system bar in Android 3.0? It's an internal device and I'm managing navigation ) about hiding the bar on Honeycomb devices. My clients, however, will be using the newest Ice Cream Sandwich devices and are very keen on hiding the bar at the bottom the screen. Their application

How can I force the Action Bar to be at the bottom in ICS?

非 Y 不嫁゛ 提交于 2019-11-26 15:13:14
Ice Cream Sandwich (Android 4.0) adds the option of having the Action Bar at the bottom of the screen on phones, and that's something I'd love to have in an application of mine. The docs mention uiOptions="splitActionBarWhenNarrow" for when you want something, i.e. tabs, at the top and Action Bar shortcuts at the bottom. I've tried adding the line in the application manifest, as described in the docs, but haven't got it working thus far. Here's an example: Also, I noticed that on my Galaxy Nexus, which runs ICS, that the messaging application has the Action Bar the bottom and nothing but the

MediaButtonIntentReceiver not working in Android 4.0+

天涯浪子 提交于 2019-11-26 14:38:40
问题 The goal is to intercept broadcasts from the headset, as well as bluetooth eventually, to respond to different types of clicks from the headset to alter the mediaplayer. This solution works fine for all versions prior to ICS. Here is some of the code and things I have tried: .... private BroadcastReceiver mediaButtonReceiver = new MediaButtonIntentReceiver(); .... public void onCreate() { ... IntentFilter mediaFilter = new IntentFilter(Intent.ACTION_MEDIA_BUTTON); mediaFilter.setPriority

getView returning null when fragment has been created from an activity

◇◆丶佛笑我妖孽 提交于 2019-11-26 14:36:49
I have a working tablet application which I am now trying to make work on phones too. On a table there is two fragments on the screen a list fragment and a details fragment. When on a phone the list fragment appears and creates a new activity when a list item is pressed. This activity simply creates the fragment in the onCreate() method and commits it to the screen as follows. // Place an DeallDetailsFragment as our content pane DealDetailsFragment f = new DealDetailsFragment(); getFragmentManager().beginTransaction().add(android.R.id.content, f).commit(); getFragmentManager()

Issue: Passing large data to second Activity

白昼怎懂夜的黑 提交于 2019-11-26 13:05:35
问题 I\'ve got an strange issue. I was looking around the web but didn\'t find an answer. I\'m still a beginner in android programming. So let\'s go: All I want to do is calling the second Activity with some data. It works fine with small data, but if the data gets large, the second Activity will not show and the first one finishes. Here\'s my code of the calling Method: Intent intent = new Intent(ActivitySearch.this,ActivityResults.class); Bundle bundle = new Bundle(); bundle