Android : Multiple Activity Instances Launched By Same Intent. Bring One Uniquely To Foreground?

Nov 12, 2010

I'm struggling with my app that launches multiple instances of the same Activity using the same intent. My main activity is of class type A and it does a startActivity() of two children that are of the same class type B. So we have B1 and B2 launched. If B1 and B2 are both paused (by pushing back button and making sure finish() is not invoked on them so they are truly paused), how can A uniquely bring either B1 or B2 to the foreground again? I do want to launch a new B activity. I want to uniquely bring B1 or B2 to the foreground.

so both B1 and B2 were created like this... Intent intent = new Intent(context, B.class); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(intent);

Now I want A to bring B1 (or B2) to the foreground/front so I use the below code, but how do I distinguish B1 or B2 when starting the activity? This only brings the last instance of B that was on top to the foreground.

Intent intent = new Intent(context, B.class); intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); startActivity(intent);

I've tried keeping around references to B1 and B2 and doing something like this, but this also only goes to the last instance of activity class B that was on top...

Intent intent = new Intent(B1context, B.class); intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); B1context.startActivity(intent);

I even tried this, but it still doesnt get me my unique B1 or B2... Intent intent = B1.getIntent(); // i.e. the original intent that started me startActivity(intent); // still only brings to front the last B that was on top.

Android : Multiple activity instances launched by same intent. Bring one uniquely to foreground?


Android :: Intent Filters - Prevent Creation Of Multiple Activity Instances?

Feb 16, 2010

I added an intent filter to one of my activities, so that when a user clicks a URL like "www.mysite.com", and if my app is installed, my registered activity can be launched. It works well.

I see that this creates a new instance of my registered activity though, every time a link is clicked. Is there any way to prevent multiple instances from being created - just recycle an existing instance if one already exists?

View 6 Replies View Related

Android :: Launch Intent In Background Then Bring To Foreground?

Jul 19, 2010

Is there any way to launch an activity w/ Intents (in this case the Browser) in the background, and then bring it to the foreground using a service or activity?

I know it's possible to bring apps to the foreground by launching an intent with FLAG_ACTIVITY_BROUGHT_TO_FRONT

But is it possible to initially launch the activity in the background?

View 3 Replies View Related

Android : How To Bring An Activity To Foreground (top Of Stack)?

Feb 9, 2010

I defined an activity ExampleActivity.

When my application was launched, an instance of this activity was created, say it is A. When user clicked a button in A, another instance of ExampleActivity, B was created. Now the task stack is B, A, with B at the top. Then, user clicked a button on B, another instance of ExampleActivity, and C was created. Now the task stack is C, B, A, with C at the top.

Now, when user click a button on C, I want the application to bring A to the foreground, i.e. make A to be at the top of task stack, A, C, B.

View 4 Replies View Related

Android :: How To Bring Stop Activity To Foreground (restart) By Itself ?

Sep 22, 2010

How to bring stop activity to foreground (restart) by itself?i use Broadreceiver and intent to restart my activity.but always start two activity (include original activity)how to restart my original activity?

View 4 Replies View Related

Android : Bring An Activity To Foreground From Background Manually?

Oct 19, 2009

In my application i wait on socket for network events.On some events i have to bring activity into foreground(make activity as running) if at all it is not in the foreground.

View 17 Replies View Related

Android : Bring My Activity To Foreground Automatically From Address Book

Sep 25, 2010

My Activity is running on the foreground and my Activity is getting pushed to background when I hit on the home button... I am trying to display the pop up at certain intervals, in this case as my activity is running on background when I try to display the pop up but thats not shown on the foreground.

View 1 Replies View Related

Android :: Starting Activity With FLAG ACTIVITY MULTIPLE TASK To See Multiple Instances

Feb 2, 2009

I am trying to launch an activity from another activity .. Within the com.android.SingleLauncher..

I have activity launch code as ..

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

I have set the android:multiprocess="true" in the AndroidManifest.xml of TargetSL I don't seem to see the multiple instances of TargetSL, which i am expecting ..

All i see is 2 process, where i was hoping to see an instance of TargetSL, for each launch that was invoked by the singleLauncher!

View 3 Replies View Related

Android : By Clicking On My App's Launcher Icon, Bring My App To Foreground And Not Launch New Activity

Feb 28, 2010

My app has 2 activities - A and B. From homescreen I launch A, from A I launch B. The activity stack looks like this: A-B. Now I press HOME button, and from homescreen click again on my app icon, which launches A and adds it on top of the activity stack, which now looks like this: A-B-A. But I just want to bring my application to foreground, is that possible in Android?

View 2 Replies View Related

Android :: Starting Two Instances Of Activity With Flag Intent

Jul 18, 2010

When starting two activities of the same class within the same instance using the flag REORDER_TO_FRONT, the new extra information of the second call does not override the first starting activity. Is this the desired behavior? How do retrieve the new extras?

For example: In the StubActivity, I have this code:
Intent i = new Intent(this, A.class);
i.putExtra("foobar",1); startActivity(i);

Activity A is displayed, and then this code is called upon a button press:
new Intent(this, A.class);
i.putExtra("foobar",2);
i.setFlag(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
startActivity(i);

Activity A is re-displayed. Now check for the extras: int foobar = getIntent().getExtras().getInt("foobar")
Turns out that foobar = 1

View 2 Replies View Related

Android :: How To Create Multiple Instances Of An Activity

Feb 19, 2010

I want to create multiple instances of an activity in the same process. Should I use FLAG_ACTIVITY_NEW_TASK flag like the code below?

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

This code is executed in class A to create another instance of activity A.

This question, will this code create another task? As I understand is a process can only have one task. Does it mean the two activities will exist in different tasks? That's what I want. I want the two activities to be in the same process.

View 1 Replies View Related

Android : How To Create Multiple Instances Of An Activity?

Jul 1, 2010

I was wondering is it possible to create multiple instances of a single Activity in Android?

I currently start my own inCall screen for a Voip Test by using the following code...

This allows me to start the Activity fine. However when I call it for a second it just returns to the Activity already created rather than creating a new Activity and placing it on the stack.

I would like to be able to create the activity multiple times so that I have two or 3 Activities on the stack and the user can switch between them, using Home, Back buttons etc... Is this possible and if so what am I doing wrong?

View 1 Replies View Related

Android :: Mulitple Instances Of Pending Intent

Sep 16, 2010

I created a widget that when clicked activates a PendingIntent.The problem is when I have more than one widget on the screen only the latest one will start the PendingIntent.I have read some about a unique request code, but not figured this out.Any ideas how I can have multiple widgets and the PendingIntents work for each?

View 1 Replies View Related

Android : How To Run Multiple Instances Of Same App?

Sep 14, 2010

is it possible to run multiple instances of the same app on android? What I mean if the app does not support multiple identities is it possible to install it twice and configure each instance separately?

View 1 Replies View Related

Android :: Multiple Instances Of Service?

Apr 15, 2010

I would like to do this, let me know if it possible in android?

App1 --> bindService() or startService() to AndroidService1 App2 --> bindService() or startService() to AndroidService1 (same service)

I would like App1 and App2 to get different instances of AndroidService1. Why I want to do this is say App2 doesn't need the service any more & it calls stopService() then App1 should still continue to work with its own instance of service app.

View 2 Replies View Related

Android : Multiple Instances Of Included Layout - Namespacing

Jan 12, 2010

I've been attempting to use the <include> tag in some layouts and it seems that these are of limited use because of the flat namespace of the R.id.x approach.

Suppose I have a layout (attribs and xml namespace decl omitted for clarity).

CODE:.......

Now in my java code I have a conundrum. I am not able to identify each individual instance o f the children included layouts root view. In the include tags I can replace the root id with "row1" and "row2" so I can find the individual linear layouts using findViewById

eg:

CODE:.........

However, I can't easily access the two instances of the TextView which are children of row1 and row2 because all I have to play with is the single id "text"

ie:

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

In this case, which instance (row1.text or row2.text) does this refer to, both of them, or none?

I guess I would need to use another means of accessing the children of row1 and row2.

View 3 Replies View Related

General :: Possible To Run Multiple Instances Of Same APK?

May 13, 2014

I'm wanting to install 2 instances of the same APK.The app is: Star Wars Force Collection..Once you install the app and login to your account, theres no way to change accounts without uninstalling / reinstalling and logging into new account.

View 4 Replies View Related

Android :: Can I Save SharedPreferences To File So I Can Have Multiple Instances Of The Prefs?

Jul 19, 2010

I love how SharedPreferences work in android and I would like to know if there is an easy way to save them to another file so I could load a previous instance of the prefs and vice versa. Basically when you load this file, all the preferences would change to how you had it before at once. I want to be able to swap 3 or 4 different versions of the same pref keys in this way. Is there an easy way to do this?

View 1 Replies View Related

General :: How To Install Multiple Instances Of Same APK

Jan 25, 2012

I was tinkering and editing an apk, and i managed to compile it and install it fine and it works and is suited to me. So i was wondering ( not too good with xmls ), is it possible to edit the manifest file to rename the apk so I can install multiple copies ( i.e. have the original unmodified one and the modified one at the same time ). I need this for testing purposes. Which lines do i need to edit exactly so the phone doesn't give me the "installing this application will replace the current..." warning, so I can multiple instances of it?

APKs are managed by package name, not by file name, but you can't simply change the package name in the manifest of a compiled APK.

Even assuming you manage to do it without messing up the file, which is not a simple task, there will still be code referring to the package name, so the app will crash.

View 4 Replies View Related

HTC Incredible :: Run Multiple Instances Of Calendar Widget?

May 3, 2010

OK, here goes my first post.

I have the calendar syncing with my gmail calendar, which has multiple calendars inside (mine, my wifes, ours, baseball schedule, cavs schedule, etc..)

I also have the stock "mail" (not Gmail) application syncing with my exchange at work.

Since I got 7 home screens to work with, I wanna put my Gmail calendar on home screen #1, and my exchange calendar on home-screen #7. Sort of a seperation of home and work

So I put the stock widget on home-screen#1, and again on home-screen#7. But a widget is basically just a frontend for an app running in the background. When I go to home-screen#1 and select MINE, WIFES, and CAVS.......that selection affects the widget on home-screen #7 as well. I go to screen #7, tell it to display Exchange only.......and when I go back to #1, it is switched to exchange.

So.....any way to do what I want?
1) Have a calendar on home-screen#1 that shows my Gmail calendar(s)
2) Have a calendar on home-screen#7 that shows my Exchange calendar

View 2 Replies View Related

Android :: Cyberon Voice Commander In Multiple Languages Are Launched In Market

Oct 29, 2010

Cyberon Voice Commander provides a natural and reliable interface to enhance the communication between people and mobile phones. It is one of the most popular products from Cyberon Corp. Now French, German, UK and Iitalin version of Cyberon Voice Commander are launched in the Android Market, and more than 16 kinds of language are scheduled to be launched in the near future. It not only benefits worldwide consumers to speak their native language, but also make mobile phone more useful. Multi-language version of Cyberon Voice Commander supports Android 1.5 and above verions, selling USD5.99 in Android Market .

Main Features:

1) With Speaker-Independent (SI) recognition technology, users can use directly without any training or recording in advance.

2) Through Cyberon Voice Commander, you can control your mobile phone with voice, such as dialing to contact, check time, navegating an application and so on.

3) In addition to accurate identification, Cyberon Voice Commander also provides a number of possible recognition results, so that you can operate it in more convenient way.

4) Cyberon Voice Commander supports Bluetooth headfree with Android 2.2 version. It ensures user's safety when they are driving.

5) No network connectivity is required for using Cyberon Voice Commander.

View 1 Replies View Related

Android : Get Activity To Foreground

Mar 3, 2009

Who knows how I can make Activity visible from invisible process? .....

View 2 Replies View Related

Android :: Get Instance Of The Launched Activity

Jul 19, 2010

Is there any way to get the instance of a launched activity(or any view in that activity )of a application in another application.

View 1 Replies View Related

Android : Start An Activity WITHOUT It Becoming The Foreground One?

Apr 22, 2010

Is there a way to call startActivity(Intent) without the newly started activity displacing the current one as the active, foreground activity?

If not purely so, are there near approximation to this effect that can be done, such as mimicking a back keypress event right after calling startActivity()? If so, which means is preferred?

View 5 Replies View Related

Android : Activity Not Coming To Foreground

May 2, 2010

I'm getting the outgoing number using BroadCastReceiver and then starts a Activity. but my activity runs in the background??? how can i bring it to foreground? ...

View 5 Replies View Related

Android :: Differentiate Emulator Instances And Real Device Instances

Jul 22, 2009

I need to correctly be able to differentiate between emulator instances. I know it's easily done with real devices. With real devices, you can use getDeviceId or getLine1Number from TelephonyManager. With emulators, all the instances have the same device id, same subscriber id, and same line1 number. Is there a way to differentiate them? Using NetworkInfo, I can call the toString method and I get my ip and the port on the computer. The problem with that is that the port is always different. I would like something more stable. Like when you use "adb devices" in command line. Emulator #1 is almost always "emulator-5556" and emulator#2 is almost always "emulator-5554". Is there a way to get the same info I get from "adb devices" in my code? If not, is it possible to use a command line parameter to force the emulator to use a certain phone number?

View 3 Replies View Related

Android :: Recieveing A Notification When An Activity Is Launched

Jun 30, 2010

Is there a way of recieving a notification of some sort when a activity is launched. I'd like to monitor which applications are used and how often. Is is possible to register for some broadcast telling me when an application is launched, installed, unistalled etc? I believe I found a discussion or solution to this yesterday when I was looking for something else, but I'm not able to find it today.

View 3 Replies View Related

Android :: BroadcastReceiver To Listen For Activity Being Launched

Jun 22, 2010

I am wondering whether is possible to use a BroadcastReceiver to listen for an Activity being launched. I have no control of the Activity I need to know about as it is from the Android platform.

View 3 Replies View Related

Android :: Notified When Foreground (top) Activity (application) Changes

Oct 6, 2010

I want to write a service for Android platform that is notified when the current foreground activity changes. Basically the service should do some tasks only when the top activity changes. Is there any way to subscribe and to be notified when this kind of event occurs? Or there is no possibility and the service should poll from time to time the list of running activities and to check what is the foreground activity ?Not preferable solution...

View 1 Replies View Related

Android :: Get Foreground Activity Displayed On Screen

Apr 22, 2009

Is it possible to get listed the apps or activity which are actually displayed on the screen of the android mobile. I need to display a text box on some event when no acitivity is displayed, excepting the home screen.

View 3 Replies View Related







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