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.

Android :: singleTask not as described?


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 :: 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:.....................

View 5 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 :: Android How To Send Data From Server To Android With No Request From Android?

Oct 19, 2010

today i meet the problem.i need technic can control the android machine from server.then i want send data from server to android with no request from android.

View 2 Replies View Related

Android :: Android 1.6 - Android - View - WindowManager$BadTokenException - Unable To Add Window - Token Null Is Not For An Application

Apr 14, 2010

I'm trying to open a dialog window, but every time I try to open it it throws this exception:

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

I'm creating it by calling showDialog with the display's id. The onCreateDialog handler logs fine and I can step through it without an issue, but I've attached it since it seems like I'm missing something:

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

Is there something missing from this? Some questions have talked about having this problem when creating a dialog from onCreate, which happen because the activity isn't created yet, but this is coming from a call from a menu object, and the appContext variable seems like it is correctly populated in the debugger.

View 3 Replies View Related

Android :: Android WebView Not Loading A JavaScript File But Android Browser Loads It Fine

Jun 3, 2010

I'm writing an application which connects to a back office site. The backoffice site contains a whole slew of JavaScript functions, at least 100 times the average site. Unfortunately it does not load them, and causes much of the functionality to not work properly. So I am running a test. I put a page out on my server which loads the FireBugLite javascript text. Its a lot of javascript and perfect to test and see if the Android WebView will load it. The WebView loads nothing, but the browser loads the Firebug Icon. What on earth would make the difference, why can it run in the browser and not in my WebView? Any suggestions.
More background information, in order to get the stinking backoffice application available on a Droid (or any other platform except windows) I needed to trick the bakcoffice application to believe what's accessing the website is Internet Explorer. I do this by modifying the WebView User Agent.Also for this application I've slimmed my landing page, so I could give you the source to offer me aid. package ksc.myKMB;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.Window;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.webkit.WebSettings;
import android.webkit.WebViewClient;
import android.widget.Toast;
public class myKMB extends Activity {
I already have JavaScript on the web browser on, the problem is the web view is acting to different from the web browser.

View 1 Replies View Related

Android :: Resolve The Error - Com.android Internal R Cannot Be Resolved - Using Android File MultiAutoCompleteTextView.java

Aug 15, 2010

I want to implement my own Tokenizer base on the file
"MultiAutoCompleteTextView.java",

but I encounter an error "com.android.internal.R cannot be resolved" when I try to

import "MultiAutoCompleteTextView.java" to my project.

code:.................

I haven't research any solutions to resolve this problem.How to correct "com.android.internal.R.attr.autoCompleteTextViewStyle" my own attr?

View 1 Replies View Related

Android :: Does Android Eclair Code Base Support Plugins In Android Browser?

Jan 11, 2010

1- Does Android Browser (Éclair code base) support the "plug-in" or not?

2- Why "Google Gears" support is removed from the clair code base?

I searched the forum and came to know that earlier version of the Android does not support it at all? Here is the link for that, but this query asked in Dec'2008.

View 2 Replies View Related

Android :: Android How To Edit Specific Record From Database In Android Programming

Jan 5, 2010

At first,I have a database created by using Ruby on rails.I just already implement insert function(HTTPPost) in my Android Application and it's work.But I don't know how to retrieve specific record from my databases and insert it back to specific record in Android (Like edit function in RoR)This is my insert code :
private void insertComment() {DefaultHttpClient client = new DefaultHttpClient();HttpPost post = new HttpPost("http://10.10.3.87:3000/comments");
// Configure the form parameters
List<NameValuePair> nvps = new ArrayList<NameValuePair>();
nvps.add(new BasicNameValuePair("comment[content]", t_comment.getText().toString();
nvps.add(new BasicNameValuePair("comment[id_account]", "1"));
nvps.add(new BasicNameValuePair("comment[id_place]", Integer.toString(position)I really try many ways out but it doesn't work and it takes very long time to fight with this piece of code. Actually, I really don't know how to specify RowID to HTTPPost.

View 2 Replies View Related

Android :: Android.. How To Upload Data From Android Phone To Remote Database?

Sep 17, 2010

I am doing some android development, and now I need to send some android application generated data onto a remote server (a database)?How can I do that? can I use direct JDBC connection and sql?

View 1 Replies View Related

Android :: Sending Info From Android Phone To An Computer IP With Android Emulator

Oct 9, 2010

So i am making a android app, and i want it to be so if i call lets say 911 it sends my GPS coordinents to a certain IP, i know everything but how i make it so if i call 911 it sends the info and how i can make it send the info to the IP via 3g,

View 3 Replies View Related

Android :: Android Market Hiding Apps With Bluetooth Permissions From Android 1.5 And 1.6

Jul 10, 2010

I released updates of my apps yesterday and they are being hidden from android 1.5 and 1.6 phones.

This is due to a Market bug which hides apps with bluetooth permissions from android 1.5 and 1.6.

Come on Google fix the market. We spend countless hours making are apps work on ALL android versions and now you do this...

This issue has been raised since June, but has only affected me since i made an update to the market yesterday.

View 1 Replies View Related

Android :: Mock And Performance Tests Available In Android For Testing Android Application

Dec 23, 2009

What exactly are mock tests... I need to know the mock and performance tests available in android for testing android apps..what is the best tool for testing android apps and how..

View 1 Replies View Related

Android :: Android - Add Menu Item To Android's Built-in Apps

Aug 17, 2009

I'd like to add a menu option to the Android camera app. Is this possible to do using the current SDK? I know I need to add an intent-filter tag in my activity. But I don't know what I should put in the mime type. I want to be able to process the live camera previews if the user selects the menu option. So what do I put into the type tag of the intent-filter? Also I suppose I won't be using ALTERNATIVE or SELECTED-ALTERNATIVE for the category as I want to deal with the whole intent?

View 3 Replies View Related

Android :: Does The Android Market Check Installed Android's Version ?

Jan 21, 2010

I was wondering if the market checks if the application can be installed on the device. For example, if I have an Android 1.6 and if I try to install an application with :"<uses-sdk android:minSdkVersion="7" />" on its manifest. What will happend ?

View 4 Replies View Related

Android :: Android IRC Office Hours - Android Bluetooth RSSI

Jan 27, 2010

I have a question about bluetooth RSSI functionality on the Android (either 2.0 or 2.1):

It's easy enough to get the RSSI value when a bluetooth connection is created, but how can you repeatedly get the RSSI value of a connection that is already active? It's really important to be able to do this, because this lets you determine if bluetooth devices are close to each other or far away, but I can't find any appropriate function calls in the Android API.

View 2 Replies View Related

Android :: Moto Android Stuck On Android Splash Screen

Feb 5, 2010

I am having a bit of a problem with my Android. So what happened was I downloaded "DroidRootPro" from the market. I rooted my phone with this, installed the 800MHZ ROM image, rebooted and the phone came up great. I was actually surprised on how fast it became. Once the phone came back up, I tried installing one of the custom themes that came with that app (I know I should have left it alone). The phone than rebooted and I was never able to bring it back up. It gets stuck in this endless loop where it tries to boot but doesn�t get past the "Droid" splash screen, it just keeps rebooting every time.

Things I have tried:

-Wipe data/factory reset (in recovery mode), no go.
-Wipe cach partition, no go
-Restore from a "nandroid" backup, no go. I tried pretty much every combination of restores and am unable to bring the phone up.

Is there anyway I can download the factory image that comes with the phone, put it on an SD card and restore to that? I have looked all over but cant find any information on this.

View 1 Replies View Related

Android :: How To Reference R.java Of Other Apps In Android - Like Com.android.music

Sep 29, 2010

I am trying to develop an app to supplement the built-in music player. I've used git to download the com.android.music package and looked around at its code. I can launch the music player by copying some of its code and launching activities with intents.

Now what I need to do is get a handle to its current view. In the MusicUtils.java file, I see a line that says

View nowPlayingView = a.findViewById(R.id.nowplaying);

I'd like to do the same thing. Only I don't have access to the R.java file, so I can't write e.g. R.id.nowplaying. How do I do this? How do I reference the music players R.java? I do know the R.java stuff is declared public so that shouldn't be a problem. Right?

Is it even possible? I saw this related question and am now wondering: http://stackoverflow.com/questions/2437271/how-to-load-com-android-music-code-into-eclipse-and-compile

I'm working against the Android 2.2 SDK, but it'd be helpful to know if the answer is different for older versions such as 1.5.

View 2 Replies View Related

Android :: How To Write Android.mk For An Application Using Com.google.android.maps.jar

Aug 26, 2010

I am developing an application using com.google.android.maps.jar It is OK to develop it with Eclipse SDK. but an build-error happens when building system.img with GMS licence (com.google.android.maps.jar is already installed at out/target/common/ obj/JAVA_LIBRARIES/com.google.android.maps.jar_intermediates/ com.google.android.maps.jar)

make: *** No rule to make target `out/target/common/obj/JAVA_LIBRARIES/ com.google.android.maps.jar_intermediates/javalib.jar', needed by `out/ target/common/obj/APPS/LifeStory_intermediates/classes-full- debug.jar'. Stop.

Here is my Android.mk

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

View 4 Replies View Related

Android :: Android AsyncTask Testing With Android Test Framework

Feb 23, 2010

I have a very simple AsyncTask implementation example and have problem to test it using Android JUnit framework. It works just fine when I instantiate and execute it in normal application. However when it's executed from any of Android Testing framework classes (i.e. AndroidTestCase, ActivityUnitTestCase, ActivityInstrumentationTestCase2 etc) it behaves sarngely:

- It executes doInBackground() method correctly
- However it doesn't invokes any of its notification methods (onPostExecute(), onProgressUpdate(), etc) --
just silently ignores them whitout showing any errors. This is very simple AsyncTask example................................

View 2 Replies View Related

Android :: Android WiFi With Out An Android Mobile Data Plan

Nov 26, 2010

I was woundering if i bought a Cell Phone with out a Data Plan that had Android WiFi that i could still access the Android Network when I was in a WiFi area?Is Android WiFi Apps the same as Android Mobile Apps?

View 13 Replies View Related

Android :: Signed Android APK-File Running On X86 - And ARM - Android Devices

Dec 28, 2009

Android APK-Files are not binaries but byte-code-files. So is it possible to install the same APK-File on both - on x86-Android-Devices and ARM-Android-Devices? There are some x86-Netbooks with Android installed planned and I wonder if it is possible to run the APK-Files on both kinds of devices?

View 1 Replies View Related

Android :: Do I Need A Android Phone For Creating Android Applications?

Jun 17, 2010

I started developing android applications. And am testing with the android emulator. Do I really need android phone before releasing it for public usage?

View 6 Replies View Related







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