Android :: Behavior Of SingleTask Not Consistent With Document

Mar 31, 2010

I have an app with two activities, one of which the launchmode is set to "singleTask". From the Android dev guide, I got the impression that my SingleTaskActivity should start a new task (or reuse an old task) and always sit at the root of the stack when launched.

However, it's inconsistent with the behavior of the app if I follow the steps below: - launch StandardActivity from home - click the "home" key - launch SingleTaskActivity from home, you will see it's in the foreground as expected - click the "Back" key, StandardActivity comes to the foreground whereas I expect to see the home screen because SingleTaskActivity is supposed to be at the ROOT of the stack. It appears SingleTaskActivity was launched into the task that StandardActivity started, rather than starting its own task.

Is my understanding about the "singleTask" launch mode correct?

=== The Android Dev guide (http://developer.android.com/guide/topics/ manifest/activity-element.html#lmode) says:

In contrast, "singleTask" and "singleInstance" activities can only begin a task. They are always at the root of the activity stack. Moreover, the device can hold only one instance of the activity at a time — only one such task.

CODE:.....................

Android :: behavior of singleTask not consistent with document


Android :: SingleTask Not As Described?

Sep 10, 2010

I've been learning Android and have come across an issue with launchMode="singleTask". The documentation states that when this attribute is used, the Activity is always launched into a new task as the root Activity. Secondly, the documentation states that if an Intent is targeted at such an Activity when there are Activities sitting above it in its task stack, such Intents are discarded (although the task is still brought to the foreground).I've been playing around with this, and the behaviour I observe is completely different. In particular:
- Activities with launchMode="singleTask" are not always the root Activity in a task stack. They are just plonked ontop of the existing stack with the same affinity.

- When an Intent is targeted at such an Activity and there are other Activities above it in the stack, the Intent is not discarded. Instead the Activities above it in the stack are discarded. The Intent is then delivered via onNewIntent to the Activity as normal.

Can someone confirm that this is the actual behaviour? If so, why are the documents incorrect? If not what have I done wrong.

View 1 Replies View Related

Android :: SingleTask Does Not Work As Expected

Nov 12, 2010

I have an application that runs in the background, and displays an error message via the notifications system. This notification has a pendingIntent that leads back the the app's main screen. On this main screen, I have set launchmode="singleTask". As I understand it from the Android Dev Guide, this should mean that my main activity will only ever have one instance.However, if the user is viewing that activity at the time (or another one within the app), and goes and touches the notification to clear it, it goes ahead and puts another copy of the activity on the stack, so if I hit the back button, it will return to the main screen again (from the main screen).

View 2 Replies View Related

Android :: SingleTask Really Always At Root Of Activity Stack?

Sep 16, 2009

In the documentation it is stated that an activity with launchMode="singleTask" is always at the root of the sctivity stack. However, when I run my "singleTask" activity for a few scenarios and monitors behaviour with "adb shell dumpsys activity" I can see it placed both at the top of the stack (with numActivities=2) and in the middle of the stack (with numActivities=3). The activity at the root (frontOfTask=True) has a "normal" launchMode.Is the documentation incorrect or am I missing something?

View 5 Replies View Related

Android :: SingleTask / Activity Stack Not Preserved?

Feb 18, 2010

I have an activity, ActivityA, and its launchMode is set to "singleTask".I start the application from the app tray. ActivityA launches ActivityB from a button click. ActivityB is a normal activity with no launchMode set ("standard").With ActivityB on top of the activity stack, I hit the home button, then resume the app, I see ActivityA instead of ActivityB when resumed.Shouldn't the history stack be preserved in this case, and B be showing? When I resume, I see A get onNewIntent() called, and I'm not sure why this is happening. I thought the stack would be preserved.

View 1 Replies View Related

Android :: Way To Pass Bundle To Activity Set As Singletask?

Apr 22, 2010

So I have a MapActivity that runs an asynchtask that occasionally updates what exactly it's displaying on the map (via a string). I originally pass this string in from the intent when the activity is first created. And then if you click on one of the drawables on the map, it opens a new activity, which can then create a new mapview (same class) with a different string setting. The problem I have is that I only want one instance of the mapview to be running at once. Thus I set android:launchmode="singletask" in the manifest. This works in that it brings the mapactivity to the front, but is there any way to send it a new intent bundle to get a new setting for the string it needs? I tried regetting the extras from the bundle, but it seems to retain the old bundle, not the new intent that was passed to it. I'm not sure I want to do startActivityForResult because the 2nd activity may or may not want to update the original activity. I hope that made sense. I can post code if necessary, but I think that should explain my situation.

View 2 Replies View Related

Android :: SingleTask - SingleTop - Properly Implement A GUI?

Oct 13, 2009

Our application which consists of something like this: Main menu => View contacts => Edit contact => View groups => Settings => Browser settings

I have then added gestures so that the user can jump between any of these screens with a gesture. But this leads to a huge activity stack that just grows and grows so how should I properly implement this?

I thought about the following: Main menu (SingleTask) => View contacts (SingleTop) => Edit contact => View groups (SingleTop) => Settings (SingleTop) => Browser settings (SingleTop)

If I do nothing then I end up with something like this (using gestures): Main menu - View Contacts - Main Menu - Browser Settings - View Contacts - Main menu

I would guess this would lead to memory issues sooner or later?

View 5 Replies View Related

Android :: LaunchModes - SingleTask - Switch Between Screens - Intents Only Way

Jan 9, 2010

In a number of questions (like this one) I have been looking into how to "change screens" in my app. I have a "header" on top, with 4 buttons. Each button is meant to replace the "content" (ie change screen):

+--------------------+
| menu with buttons |
+--------------------+
| |
| |
| C O N T E N T |
| |
| |
+--------------------+

When I click a Menu button, I run the following code:

CODE:..............

As you can see, the startActivity is executed. Now, if I do not specify "launchMode" for the Activity that means that launchMode = normal. If launchMode == normal that means that the Activity will be re-created each and every time I navigate using the top header buttons, and that means that all data entered in "form elements" are gone (or at least hidden).

So, I found the launchMode "singleTask" that sounded sort of nice. If I add that launchMode to my Activity, it will not be re-created when I navigate with the buttons, thus keeping state. Great! Well, until I read this:

As noted above, there's never more than one instance of a "singleTask" or "singleInstance" activity, so that instance is expected to handle all new intents.

I found out that the sentence mean that there can be only one Activity that has the launchMode set to "singleTask" - if I have more than one it wont work (no compiler error though).

This means that I can only "keep the state" for one Activity, when switching back and forth (navigating) between my screens!

View 3 Replies View Related

Android :: Launch App From Eclipse For Testing - LaunchMode Is Set To SingleTask

Jun 23, 2009

I've come across a very annoying problem, which only seems to happen when I launch my app from eclipse for testing. If I launch it normally, it doesn't seem to have this problem.

This is how I can reproduce it: - Launch app via Eclipse - Press Home - Relaunch app via icon - Click menu->exit which tells the Service to clean up and calls finish () when the Service finishes cleaning up

For some reason, there seem to be two instances of the activity, one exits normally and the other one gains focus. Clicking exit does nothing since the Service has stopped but the Service variable is not null. Attempting to use the app launches errors since the resource it uses have been closed. I can force a close via the crash and relaunch the app, and it exits normally this time.

As I said, it only happens when launching the app via Eclipse. Anyone know what could cause this? My launchMode is set to singleTask, however, that shouldn't cause an issue, I used that mode before. I tried calling finish() regardless of the state of the Service, but it doesn't seem to help.

View 5 Replies View Related

Android :: OnPause() Not Being Called For SingleTask Finish()'d Activity?

Feb 17, 2010

I'm not sure why onPause() is not called in the following scenario.

Here's my activity:

CODE:.......................

View 3 Replies View Related

Android :: Intent.putExtras Not Consistent

May 16, 2010

I have a weird situation with AlarmManager. I am scheduling an event with AlarmManager and passing in a string using intent.putExtra. The string is either silent or vibrate and when the receiver fires the phone should either turn of the ringer or set the phone to vibrate.

The log statement correctly outputs the expected value each time.

CODE:..........

The receiver that fires when the alarm executes also has a log statement and I can see the first time around that the statement outputs the expected string either SILENT or VIBRATE but for each subsequent execution the output shows the original value on the receiver end. The alarm executes and then I change the value for putExtra to opposite string and the receiver still displays the previous value event though the call from the code above shows that the new value was passed in. The value for setAction is the same each time.

CODE:.....................

View 2 Replies View Related

Android :: How To Maintain Consistent UI Over Multiple Versions Of OS?

Sep 9, 2010

I would like to know if its possible to prevent my application from looking different every time I run it on a different android phone. For example, on stock 2.2, my seek bar (with default values and theme) has an orange color for the selected portion, whereas on a Samsung Galaxy S (with 2.1), it is green. Also the tab background is grey in stock 2.2, but blue in Galaxy S. On a similar note, my rating bar changes size too. I do not implement multiple screen resolutions and all my drawables are located in the "drawables" folder under "res". I donot specify a minimum sdk requirement.

View 5 Replies View Related

Android :: Consistent System Bug While Using UI Test Monkey App

Dec 22, 2009

I'm using the UI test monkey tool provided with android. This is a consistent error I see and wonder how I can avoid it.

Somehow the test app will rotate the orientation of my app such that the emulator window is still in portrait orientation, but the screen surface is in a landscape orientation. When in this configuration, any time you click on an EditText, a system exception gets thrown:

"The application OpenWnn (process jp.co.omronsoft.openwnn) has stopped unexpectedly. Please try again."

So this OpenWnn process is not mine, it looks like it handles display of the virtual keyboard. When in this odd orientation mode, and you try to click in an EditText, I can see the virtual keyboard try to slide in from the left side of the screen, then that exception gets thrown.

I'm not sure what orientation this is, because it's not the normal landscape orientation you get by hitting ctrl + F11. In fact, the virtual keyboard shouldn't even be trying to display itself in landscape mode? Much less from the left side of the emulator?

View 1 Replies View Related

Android : Scroller Not Maintaining Consistent Speed / Getting Slower

Nov 22, 2010

I have a problem while using the scroller in my application. I have used the scroller but it is not working properly as it is not able to maintain a consistent speed while automatically scrolling. The speed of the text is getting slower with time as the text moves upward.

View 1 Replies View Related

Android :: String Resource ID Values Guaranteed To Be Consistent Over Different Projects

Jun 7, 2010

I have some messages being passed back from my server through php. The problem is that the messages are in English and if the user is using another language they will still get the message in English.

So I had an idea that maybe instead of passing back the message I would instead pass the String resource Id from the android app, that way the app will get the correct string id for their language. I will use this in a number of apps so I just want to know if the string id is guaranteed to be the same across different android projects?

View 3 Replies View Related

HTC Incredible :: Want Contacts Consistent As Last Name First / Fix To Have In This Order?

May 5, 2010

I want all my contacts consistent - last name, first name. But When the phone consolidated everyone from Outlook, Facebook, and Google (about 800 people, everything is all screwed up and inconsistent. Is there a way to fix that without having to manually open and edit each contact not in the correct order?

View 1 Replies View Related

Nexus :: Consistent Call Drop-out Problems

Feb 21, 2010

At about 5-10 seconds into a call (either outgoing or incoming), my transmissions are muffled for about 10 seconds. Thereafter, I have occasional intermittent similar problems. I can always hear the other party perfectly; they just can't hear me. It happens with either the built-in mic or the corded headset or bluetooth.

View 8 Replies View Related

General :: Any Mod To Make Upload Speed Consistent?

Nov 22, 2013

I'm using Wi-Fi hotspot to connect my ps3 to mobile network but gameplay is slightly laggy. I've been told this is because of slow/inconsistent upload speeds. So is there an app/mod to make upload speed of my network faster or more consistent?

View 3 Replies View Related

Motorola Droid X :: 3g Connection Consistent - Drops In And Out Like Every Other 5 Seconds

Aug 3, 2010

When im at my house 3g drops in and out like every other 5 seconds I was just wondering if this is normal or not.

View 10 Replies View Related

Motorola Droid :: Slow 3G Speed With Consistent 4 Bars?

Nov 20, 2009

This is my first smartphone and my first experience with any sort of high-speed mobile internet, so talk to me like an idiot. But my 3g speeds seem to be incredibly slow and I'm hoping there's something I can do about it. I might've just chalked it up to poor coverage in this area, but I get consistent 4 bars and I've ran SpeedTest.net and XtremeLabs Speedtest and, oddly, I'm getting very high numbers for upload speeds which seems to suggest the network is fine in this vicinity and something else is going on. WiFi speeds are perfect, very quick.

Here are the results of my most recent tests.
SpeedTest.net
Download: 100 kbps
Upload: 855 kbps
XtremeLabs
Max Download: 100.2 kbps
Upload: 223.6 kbps (Don't know about the large discrepancy here)

So is there any course of action I can take to improve the situation? I've not tested speeds at any other locations yet (just got the phone Wednesday) but the high upload speed seems to tell me that it's not just a matter of my house being a 3g dead zone. And of course, this is my first experience so maybe I'm completely wrong with all my assumptions.

View 6 Replies View Related

Samsung EPIC 4G :: Consistent Battery Life And Stability

Aug 22, 2010

Battery life and Battery stability. I still cannot seem to get a good consistent battery life from my Evo. One day it lasts 10 hours the next I get only 5 hours with about the same usage time and its driving me bonkers. If I find the Epic to be more reliable with power management I'm keeping the Epic and changing over. Its all up to the battery now!

View 14 Replies View Related

Motorola Droid :: Consistent Issue W/ESE53 ROMs And Youtube Player

Mar 8, 2010

I've seen an issue now on both Chevy's and Pete's ESE53 ROMs.

I play a video using the youtube player, and the video locks up, touchscreen and phone buttons non-responsive, and then the phone reboots.

I did a full wipe/reset and installed all apps from the market when I installed Pete's ROM, so it's not due to a messy setup...

Doesn't happen every time, but very frequently. Last night I played some or all of three videos, no issue. This morning tried one and my phone locked up/rebooted within the first five seconds of the video.

View 15 Replies View Related

Android :: How To Set Notifications Behavior On EVO?

Jul 13, 2010

Does anyone know how to set the notifications behavior on the EVO? Specifically with Google Talk? I would like the phone to beep at me only once when someone sends a google talk message, and then not ever again for the following messages until I unlock the phone's screen and reactivate the google talk app. I think it already works this way for email, but not for Gtalk. Can this be done? And, I already know that if I open up the chat session, the sounds shut off on successive messages. However I would like it to stop the beeping without opening the chat window.

View 1 Replies View Related

Android :: Customize Spinner Behavior

Apr 21, 2010

I want to customize the spinner behavior a little bit. I want to add a couple of buttons at the end of the drop down menu that is displayed when the user selects the control. Any idea how this could be done?

View 4 Replies View Related

Android :: Odd Behavior With A Search Activity

Oct 24, 2009

I have a package with two activities

1. A main activity 2. A search activity

The search activity is invoked by a search suggestion provider in two possible ways

1. By clicking directly on a suggestion invoking the search activity through a VIEW action 2. By clicking on the explicit search icon invoking the activity through SEARCH action

If it is invoked through SEARCH I stay on the search activity and show some text to the user. Now when I click the back button I go back CORRECTLY to the home page.

ODD Behaviour: However if I came to the search activity through the VIEW, I invoke a browser activity and call finish() on the search activity. Now I have the browser in my view. If I now go back I would expect to go back to teh device home page. But from now where the "main activity" is showing up.

I see in the logcat a message from ActivityManager indicating

moveTaskToBack: 8

I have tried various flags to invoke the browser activity the tried flags include new task previous is top and I have also tried both a singleTop and otherwise with the SearchActivity as well. Same end result.

View 2 Replies View Related

Android :: Behavior Of Activity For Cases

Mar 18, 2010

1. I want to know the behavior of activity for the cases where onStop and on Destroy were not called like low memory situations.
2. I was registered my handler in on Create() and unregistering in on Destroy, what is the behavior if other thread sends messages to the registrants after the activity was killed by android without calling on Destroy. I know that those handler were not removed by GC as they are still referring by the thread.
3. Also suggest me to handle the above situations.

View 3 Replies View Related

Android :: Getting Right Highlighting Behavior In ListView

Sep 20, 2010

I have a ListView set up in single-choice mode like this:

<ListView android:id="@id/android:list"android:layout_width="fill_parent"
android:layout_height="fill_parent" android:background="#ff444444" android:layout_weight="1"
android:drawSelectorOnTop="false" android:choiceMode="singleChoice" android:scrollbars="vertical"
android:headerDividersEnabled="true"/>

When I press my finger on a choice, the selection changes from white text on light gray to black text on orange. But as soon as I lift my finger, the selection reverts to the original state. I'd like that chosen row to remain in the black-text-on-orange mode when I lift my finger so that the user knows what was selected in the list (my onClickListener has captured the selected row, of course). Is there a way I can tell the ListView that I want this behavior or something similar so the user knows what item has been selected?

View 6 Replies View Related

Android :: Select Behavior Of TextView

Oct 18, 2010

I have a TextView which is inside a LinearLayout which is in the child position of an ExpandableListView. Without assigning a color state selector to the text view, the following behavior is observed:Text unselected - text paints as white Text selected - text paints as black.If I add a color state selector with a call to text.setTextColor(R.color.textcolorstatelist) then the following behavior is observed:Text unselected - text paints as black Text selected - text paints as black.I tried two versions of textcolorstatelist.xml and both produced the results above.

View 9 Replies View Related

Android :: Inconsistent Handler Behavior

Sep 30, 2010

I am using a handler inside my service to display notifications at a certain time using the Handler.postDelayed method. My application runs fine on the emulator just as expected satisfying all cases. But when I installed the same on my HTC Wildfire, it simply doesn't happen as anticipated. Notifications are displayed at a random manner after the scheduled time and some notifications even fail. I'm monitoring my service from the Applications > Running Services and still my service is active.

View 1 Replies View Related

Android :: Inconsistent Ringtone Behavior

Mar 16, 2009

I am trying to add ringtones to the media/ringtones folder from my application. If the phone is connected via USB to a computer or mounted on my Mac, the ringtones do not show up in the SD Card, nor in the Ringtone settings.

But if I run the application with the USB unplugged, the ringtones appear ok. This is not a problem with Ringdroid which does the same thing.

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved