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
Jan 22, 2010
I have a simple LinearLayout with one TextView and one ImageView. I want the text in the TextView to be aligned to the right, but the result show that the Text was aligned to the left.
Is there anything wrong with my layout xml?
CODE:...............
View 6 Replies
View Related
Mar 17, 2010
Help me in resolving the below issue. I have three image buttons on screen. All these three buttons controlled under ontouchlistner as below. My problem is, as it is under multi touch event handler like above, it does not detect when touch all three button at a time to try to produce multi touch effect, instead it detects only one imagebutton touch at a time even though i touch all three image buttons. As i am developing this project on Android 1.6 SDK, is there any problem accessing my requirement(multi touch) (or) it is a known issue? I am hoping that, when it works for single button touch, why shouldn't it work when clicking three imagebuttons at a time to produce three logs printed as per my above code? Code...
View 1 Replies
View Related
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
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:.....................
View 5 Replies
View Related
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
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
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
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
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
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
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
Jan 25, 2010
The problem is that notifyDataSetChanged() is not firing up getView() of listView class.
I have an activity class in which i have Gallery Adapter and custom List Adapter (extending base class and overriding getView). What i want is, if i select any picture from gallery then, the list should get updated (dont worry about the data source now, as i am using static images for gallery and static string array for listview). After getting onClickevent from gallery i am calling notifyDataSetChanged via listView Adapter Context so that getView of listView should be called and i can supply another static string array to change the list, but getView of listView is not being called.
If i call notifyDataSetChanged from onClickEvent of listview, then getView of listView is being called. How shall we use notifyDatasetChanged to update the listview using event from another adapter.
View 3 Replies
View Related
Jul 5, 2009
I'm developing an application wich has a location push service that start at boot. The main responsability of this service is very simple, just inform the location of the phone based on the *requestLocationUpdates* parameters. I don't care if it's using the network or GPS, obviuosly I'd prefer the most accurate one, but if the GPS is turned off, I don't mind to receive the network less accurate location fix. My problem is that the service isn't working as I expect, since I deploy the app on my HTC Magic, and after a lot of miles driving my car, only the first fix is shown, but no one else. Here some snippet of my service (BTW, I've checked with DDMS that the service is launched at boot):
CODE:..................
View 6 Replies
View Related
Dec 27, 2009
I have a service that gets updated every x minutes depending on the user preferences. This service connects to a web service and pulls some data. If during an update the user has no connection I register my receiver and start listening for changes (ConnectivityManager.CONNECTIVITY_ACTION), the thing is that onReceive () only gets called on every update instead of firing onReceived as soon as I plug the connection back in. Have I understood the concept of Broadcast Receiver wrong? Is it not suppose to send a notification as soon as it detetcs a change in the connection?
View 4 Replies
View Related
Oct 12, 2009
This is continuation to the question I already asked a while back. I've been offered a solution which is not really working. Anyway - here's the problem/question. Code...
View 1 Replies
View Related
Aug 16, 2010
In the android manifest on the first line "" I'm getting an error marker (with a red X). When I mouse over the red x it says- "Manifest attribute 'minSdkVersion' is set to '2.1'. Integer is expected."
View 1 Replies
View Related
Oct 28, 2010
Is there a way to ensure that my Android UI will display as expected across different phones ?
View 3 Replies
View Related
Nov 22, 2010
I set locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 60000, 0f, this);
It has an odd behavior, locationChanged gets called every second instead of any time close to 1 minute. Secondly, locationChanged gets called every second for like 10 seconds, then stops completely, the gps satalites icon disappears, then only resumes again when the screen returns from display timeout.
what's wrong? I'm currently on android 1.5.
View 1 Replies
View Related
Oct 19, 2010
I'm requesting data from my server and receive a string in the form of 2|bit.ly|1||1| and | should be the separator. I thought the following piece of code should do the work
BufferedReader br = null; ...
br = new BufferedReader(new InputStreamReader(inputStream)); ...
String line; String[] columns; ContentValues values;
while((line = br.readLine())!=null) { columns = line.split("|"); ...
}
But after the line.split("|"); the columns contains 15 elements instead of expected 6. Taking a closer look at it's content reveals that each character in the string was stored in one array element. The code coming from server isn't encoded in any way in in the example I use only ASCII characters appear.
View 1 Replies
View Related
Dec 5, 2009
What kind of download speed should I expect with my Droid ERIS? Using my 802.11g wireless router I get around 2mb/sec according to spreedtest.net. I get around 1mb/sec using 3G. My laptop gets around 15mb/s over my 802.11g network. I'm guessing that the difference might be because my laptop has 4gb ram and a dual core and the ERIS doesn't.
View 1 Replies
View Related
Aug 10, 2010
I have come to the conclusion that vzw aborted the ota on the 1st 2.2, and not many people have gotten it. It seems at least on this forum that everyone has 2.2 via a forced update. Very few people have chimed in that they got a ota.However, given that vzw is releasing the droid2 on Thu the 12th, I would think that this is going to have the newest froyo, not the version released ota that everyone forced with. Correct thinking?
If that is also true, then shouldn't we be seing something coming out ota for us 2.1 droid 1 users very shortly? anyone have any dates?
View 38 Replies
View Related
Nov 20, 2009
When I set my HTC Hero to sync with exchange "As Items Arrive", the phone is constantly synching and therefore my battery drains. Even when I turn off the phone, the phone uis still awake since it is constantly checking/sync-ing with exchange. I was under the impression that by selecting this type of sync, the items would be "pushed" to the device rather than the device constantly checking if there are new messages, contacts, or calendar eventsto sync. Is this expceted behaviour, or is there some other tweak I need to do? By the way, I just updatedmy phone yesterdey to the latest firmware, and the issue still persist.
View 2 Replies
View Related
Jun 2, 2010
I've posted a bigger chunk of the code below. You can see that initially QUOTE was procedural- coded in place. I'm trying to learn how to use declarative design so I want to do the same thing but by using resources. It seems like I need to access the string.xml thru the @R.id tag and identify QUOTE with that string value. But I don't know enough to negotiate this.
CODE:.......................
View 1 Replies
View Related
May 10, 2010
I'm searching for android phones that can use video out to the tv for a research project. I'm considering the HTC Touch Pro.
Is there anything I have to do specifically to get the video out to work (for displaying my app on the tv)? or will the phone just display a running app on the tv without extra work?
View 2 Replies
View Related
Mar 28, 2010
I have google voice and use it for every phone call I make. I heard that there were issues with several gvoice updates, so I haven't updated google voice since 0.2.8 and it is working just fine- every call connects, no problems. Is it worth updating to the newest version of google voice with push? For those of you with 2.1 on your Eris- does google voice work for you?
View 12 Replies
View Related
Dec 8, 2009
I'm trying to determine whether or not my phone is defective, or if this is a current problem with the Cliq.
Of the apps I've downloaded, only a few of them have worked. Of those few that work, some don't work right. Has anyone had problems with these apps crashing on them, or just not working correctly?
- Nice Battery (see description at bottom of: My Ultimate CLIQ settings (so far))
- WeatherBug (kept showing the wrong location, crashed when trying to change location)
- Snake - doesn't work just says its "paused"
- RingDroid - crashes when I select the "Facebook Pop" button
- Layar - screen is rotated 90 degrees at all times
There have been others, but usually I just uninstall them right after discovering it doesn't work right.
View 3 Replies
View Related
Jun 14, 2010
I've had an HTC Desire on Orange in the UK for about 6 weeks and it is having persistent problem. Firstly despite having a strong 4-bar out of 4 signal, online services and the internet do not work at all when a 3G signal is being received (e.g. news, weather, all widgets, internet, email etc).Calls and texts do work however with a 3G signal.But when a 3g+ signal (HSDPA) is being received, all internet services as above work fine.However, when a 3+ signal is being received, the phone does not make or receive calls or text messages, and often fails to send texts. Calls I make immediately shut down (bleep + �call ended�), and incoming calls from other people go straight to answerphone. Also often when turning the data connection on/off, it freezes and has to be rebooted, and turning airplane setting on and off does not fix the problem.
I have also tried the different network settings (GSM, WCDMA, auto, etc). �GSM� sends and receives calls and texts but doesn�t work (or is incredibly slow) with internet, and �auto� and �WCDMA only� show the problems as above.I don't think this is a network/coverage issues as, as I have seen many people reporting these same issues on other networks and in other parts of the UK, and I have read that other people are having to manually turn off HSDPA to be able to make calls (using an app?). Even if I can stop HSDPA from connecting to make sure the phone works, I still can�t use the internet at all on 3g � even GSM works better!
Finally, when I connect to a bluetooth device (e.g. car and headphones) the phone will connect briefly, and then randomly disconnect. I have also seen this issue reported elsewhere.I very much like the phone and don't want to get rid of it, but these problems are making the phone unuseable.Also I don't know if I should be contacting HTC or Orange about this. Will the upcoming Android 2.2 fix these problems?Anyone know how to fix this or if I need a new handset? Are there any apps that can help? Also does the Nexus One have these problems and are they fixed by Froyo?
View 4 Replies
View Related
Sep 16, 2009
So I made a discovery - my dialpad doesn't work during a call. Even if I bring it up via the softkeys, the numbers don't register a tap...anyone. else have this issue or is it just my phone?
View 49 Replies
View Related
May 2, 2010
I have so far found two bugs in Galaxo 1.6.3:
a) Speaker doesn't work in call (very weak). works well in ringtones etc.
b) Scrolling contacts by letter doesn't work.
Other than that this is a leap forward, especially with the overclock options!
Both bugs, as well as others, fixed in 1.6.3.1 update!
View 49 Replies
View Related