Android :: Can An Activity Find Out Where It Started From?
Jun 18, 2009
Is there a way to do this?
Can you access the activity stack in a way to grab what activity came before the one now in view?
I have a situation where an activity needs to know where it was started from, so it knows what data to display in that current activity.
View 7 Replies
Nov 2, 2010
I have a TabActivity, and each Tab corresponds to its own Activity. In one of them, in the onCreate method, I use startActivityForResult to show a dialog (specifically, Bump's BumpAPI activity).
code:...............
The problem is that when the screen orientation changes, it tries to create the tab's activity again which makes another BumpAPI dialog, resulting in multiple stacked on top of each other. Do I have a hook into the started activity to cancel the previous one when the orientation changes?
A workaround seems to be to add a button that when clicked, starts the second activity, but that adds an unnecessary step.
Also, I can't fix the screen orientation for the entire tabActivity because some of them require typing and users may want to use their physical keyboards.
View 1 Replies
View Related
May 1, 2010
I have following problem with my application: From my main activity ("activity 1"), there is a menu from which user can launch an action. This action will result in an Intent being received by a BroadcastReceiver, defined in my application. Finally, this BroadcastReceiver will start an activity ("activity 2") to deal with this intent.
The problem is that I have a "quit application" entry in my menu, and I can only finish() currently active activity. ie I am not able to finish "activity 1" from the menu of "activity 2". And I can't use startActivityForResult() as "activity 2" can't be started from "activity 1". Any suggestion would be much appreciated Thank you very much guys, regards.
View 4 Replies
View Related
Mar 31, 2010
I just want to get numbers of times to be used for each Activity.
So the very straightforward method I thought is increasing the count for an Activity when it was started. But how can I get the information?
View 3 Replies
View Related
Oct 19, 2010
How can I know what Activity has started the current Activity? Is there any specific method like, i.e. getIntent().getCallerActivity() or the only way is saving some information within the Intent using putExtra()?
View 1 Replies
View Related
Aug 25, 2010
I have a central activity that can be launched from two separate classes. I was hoping that in this central activity I could have an IF statement like
if(this.getIntent() == MainMenu.class)
{
// Do something here
}
But obviously that isn't legal so how could I structure an expression to check from what class an intent was started.
View 2 Replies
View Related
Jun 25, 2010
I have small simple Service and big MainActivity with UI. Service is called periodically from AlarmManager. My Service need to know if MainActivity is on the screen and inform MainActivity about state changing.
View 3 Replies
View Related
Jul 21, 2010
Suppose my application P started Activity A, and A started Activity B, then the activity stack contained A and B, with B at the top.
After that, I opened other apps by pressing Home button. Suppose after a while, the process of application P is killed by the OS. Then, I press Home button to select application P. At this time, which activity will be brought to the front, Activity A or Activity B?
View 1 Replies
View Related
Jun 17, 2010
I've a service which listens to user request for ending one activity and starting another activity. For Ex: Say there are activities1,2 ,& 3. Now if there is already activity1 started by someother activity then based on the user request i need to stop activity1 and start activity2 or activity3. If the acitivity1 is started by my service then i can do finishactivity(requestcode) and shall receive a call to onActivityResult() then i can start next activity 2 or 3. But can i stop the activity1 which is started by some other activity from a service?
View 2 Replies
View Related
Mar 19, 2010
I've successfully implemented a BootReceiver, AlarmManager, and Service per the code here: http://github.com/commonsguy/cw-advandroid/tree/master/SystemServices...
Inside the doWakefulWork method of the Service I am instantiating a few classes, but some of them require my Activity to be running. How do I actually start the Activity? The code above only starts the AlarmManager and Service.
There are also times where the Activity *is* already started, like if the user manually opened it. So I also need to start the Activity "only if it's not already running". Hows that work?
And what about the situation where the user first installs your application and may not even reboot their phone for a week. In that case, do you have to start the Service from the Activity? But then the Service will die with the Activity.
View 7 Replies
View Related
Jun 30, 2010
At the beginning Activity is launched by an Intent and something is done with this Intent. When I change orientation of my Activity, it's reloaded again and Intent is passed to the Activity. How can I clear that Intent to prevent Activity from using it again?
View 1 Replies
View Related
Apr 11, 2010
I've got an Android application which needs to be woken up sporadically throughout the day.To do this, I'm using the AlarmManager to set up a PendingIntent and have this trigger a BroadcastReceiver. This BroadcastReceiver then starts an Activity to bring the UI to the foreground.All of the above seems to work, in that the Activity launches itself correctly; but I'd like the BroadcastReceiver to notify the Activity that it was started by the alarm (as opposed to being started by the user). To do this I'm trying, from the onReceive() method of the BroadcastReceiver to set a variable in the extras bundle of the intent,Can anyone tell me what's different about passing a bundle from a BroadcastReceiver to an Activity, as opposed to passing the bundle from an Activity to a BroadcastReceiver?
View 2 Replies
View Related
Aug 20, 2010
In my app I want to obtain a gps lock and record the coords. But I do not want to lock the device into looking for the gps. The user is to be free to traverse through the app and the different activities within.
So If I call a locationListener in activity A, can I reference it in activities B C and D?
if is was still in activity A I could say something like
A.this.mlocListener.removeMyUpdates();
When I am in activity B how can I reference the LocationListener I set up in Activity A
View 1 Replies
View Related
Apr 6, 2010
i've developed an android app that's fetches an xml file and displays this data via several markers on the map. This works fine so far. The problem right now is that when i switch the orientation of the phone (portrait->landscape or vice versa) the markers disappear for a small moment, the xml processing is started again and then they reappear. Is there a way to prevent this re-loading of the file? It only takes about 2-3 seconds.
View 2 Replies
View Related
Feb 19, 2010
I want to do some data processing (in a thread) right after my main Activity starts. For that data processing to be started I also need to know a visible size of my main View (which is a LinearLayout currently, but whatever).I wonder how to do that. I.e. I wonder what is the entry point (callback?) I should use to be sure that my main View has been layed out, so i can use view.getWidth/getHeight? Is creating a custom View and reimplementing it's onSizeChanged() - the only way? In this case how should I properly describe it in my xml layout file? (it will contain some child views)
View 1 Replies
View Related
Jul 22, 2009
I have one Activity, that starts one Service and my service will lunch one Activity, i wanna to stop the Activity which one started my my Service after few seconds. Is there any way to achieve. Has anyone experienced this type of scenario.
View 2 Replies
View Related
Aug 13, 2010
In my game when the user completes a stage, I want the main game thread to pause/sleep/wait and a new activity to be launched called StageClear that displays information about points scored etc. After this has been displayed and the user has pressed continue I want the original game thread to resume where it left off. I have tried to implement this but have so far been unsuccessful, probably because I'm new to dealing with multiple threads and also the idea of synchronizing them. I most recently tried to implement a shared package-visible object that could notify after wait was called on itself, but I am getting errors in eclipse so it won't even compile, I think because though the object is declared public in an inner class, it cannot be seen or recognised by my activity elsewhere in a file in the package. I have already built both activities but my issue is getting the main game one to launch the other, and pause whilst it waits for this activity to finish, before the main game thread continues execution.
View 1 Replies
View Related
Sep 23, 2010
I have a very simple android project. I got the following error message when I try to run it. The emulator is running but the application doesn't come up. I couldn't find any useful information online.
CODE:..................
View 3 Replies
View Related
Aug 25, 2010
CODE:..........
Here is the code where the problem lies....
It doesn't give me an error it says exactly this when I run the android emulator
"[2010-08-25 09:12:42 - doppler_test] ActivityManager: Warning: Activity not started, its current task has been brought to the front"
What I think this means is that the intent of the bluetooth function and the button intent is only operation on a hierarchy system. What I mean by this is that if I were to move the button opperator above the Bluetooth stuff the button will work, but currently when the app is run Bluetooth works but when I press the search button nothing happens.
What else may be helpful is my XML code for the button so here it is......
CODE:..........................
View 1 Replies
View Related
Nov 2, 2010
I want to display a splash screen followed by my trial.class.I am not getting any error but warning as:
Warning: Activity not started, its current task has been brought to the front
I have different-2 approches for this each time this warning is being displayed.
CODE:.....................
View 8 Replies
View Related
Jul 5, 2010
I have developed an App that launches and works fine on Android 1.5 and 1.6. When I try and use it on version higher then that the app's activity starts, progress dialogs pop up and I can see my Async Task executing and the info being returned via Logcat. No errors or exceptions are shown. But the Activity never displays. All I see is the progress dialog showing over the home screen and then nothing. The process is active and running under the DDMS view.
View 1 Replies
View Related
Sep 3, 2010
I am in one activity say Activity A. I am calling another activity B.
In activity A I write the following Statement: startActivity(new Intent(this,ActivityB.class));
Now, I want to log a debug message only when Activity A is able to successfully launch ActivityB. How can I achieve this feature in Android.
View 1 Replies
View Related
May 20, 2010
When start Activity A, I found the memory usage of application is about 5MB. Then start Activity B from A via startActivity. In Activity B, I created a thread, and traverse file system in this thread, after traversing completed, call finish() and to return to Activity A. At this time, I found the memory usage of application is about 8MB (GC is forced before check memory usage). How to find Where memory leaks? By the way, I checked the memory usage with DDMS.
View 5 Replies
View Related
Mar 17, 2010
I would need to know when one activity starts or get's focus. I need this notification for any activity regardless of his type, name or whatever - not searching for one specific activity. Checked the ActivityMonitor and the Intent and I haven't found a generic intent for this purpose. Or I hadn't understood well the descriptions from the Intent ACTION_xxxxx.
View 7 Replies
View Related
Jul 2, 2010
My program has a list of tabs that each contain a list of people.Clicking a person should edit their details, but instead, clicking a person throws an ActivityNotFoundException.
View 2 Replies
View Related
Jun 14, 2010
Suppose i have a program that' s currently in a PAUSED state. Then the user launches another activity. In this second one, i want to find if the first one is in paused state or not because, if its paused, i want to recover it.
Is there a way to find if a specific activity is in pause state or not?
View 6 Replies
View Related
Aug 4, 2009
I have been looking for this for a while but I can't find any way of doing it. A contrived example would be a service that simply displays the name of the current running activity as an Ongoing Notification. For instance, when the user is reading a particular email, the name of the activity (hopefully the email title!) would appear in the notifications window and when the user switches to read a text message, the notification would change to show the name of the new activity. Is there a way to do this in Android?
View 2 Replies
View Related
Dec 9, 2009
I've created my first service, and it's all gone fine, except when the main activity is stopped. What I want is for a user action (button press etc) to start the service, which it does. Then I want the user, some time later, to press another button to stop the service. Which it does. But if the main activity loses focus (i.e. I go to the home screen) when I return to the activity it has no knowledge of the service anymore - even though the service is still running. When the activity resumes, how do I find out a) if the service is running, and if so b) re-bind to it, so that I can then stop it and collect the data I'm after.
View 20 Replies
View Related
Aug 10, 2010
I'm trying to get the ListView by using the findViewById function, yet I'm unsure what I am trying to find or what to put. R.id.list does not work.
View 1 Replies
View Related
Jun 28, 2012
I will make a theme for android and i need app activity names for custom icons. I found a website for activity name but it's not working at the moment [URL] .....
How can i find activity names of apps. Is there a website like droidicon.com
View 5 Replies
View Related