Android :: Launching Activity From Status Bar Creates New Activity / Even When One Already Exists
Nov 9, 2010
I have an activity that starts a long-running service which in turn adds an icon to the status bar. When the activity gets invisible, e.g. by pressing the Home button, and the pressing the icon in the status bar a new activity is created instead of showing the already created activity. If you now press the back button the new activity is destroyed and the activity created in the first place gets visible. How do I make the invisible activity brought to front when pressing the icon in the status bar instead of creating a new activity?
View 1 Replies
Feb 18, 2010
have an activity which launches another activity, via a button click. By default, on newer OS versions of android, the OS will animate the new activity sliding in from right to left.Is there a way to disable this animation? I just want the new activity to appear without any sort of animation.
View 5 Replies
View Related
May 21, 2010
My app consists of an Activity and a service that runs in the background. The service periodically checks a website for an alarm condition. When the service detects the alarm, it should put a user notification into the status bar. If the user clicks the notification, it should display the app's activity. If the activity is already running, that activity should become visible. If the activity is not currently running, it should be created.
However the notification created by my service *always* creates a new instance of the activity, whether the activity is currently running or not. How do I get the desirable behavior?
Here is my service pseudo-code:
CODE:...............
View 3 Replies
View Related
Apr 3, 2010
I'm having difficulties handling multiple instances of my root (main) activity for my application. My app in question has an intent filter in place to launch my application when opening an email attatchment from the "Email" app. My problem is if I launch my application first through the the android applications screen and then launch my application via opening the Email attachment it creates two instances of my root activity. steps: Launch root activity A, press home Open email attachment, intent filter triggers launches root activity A Is it possible when opening the Email attachment that when the OS tries to launch my application it detects there is already an instance of it running and use that or remove/clear that instance?
View 1 Replies
View Related
May 20, 2010
Is there a way to check and see if an Activity exists on your device? If I have a youtube video link I want to specify it open in the YouTube PlayerActivity. However, I don't want to crash if for some reason they don't have it.
Is there a way to check and see if the activity exists? I don't think I can catch the runtime exception since startActivity() doesn't throw it.
View 2 Replies
View Related
Aug 2, 2010
I have a Tabview with 3 tabs (each having their own activity). I have a tab that parses a RSS feed. How can I refresh this feed via a menu button? I tried doing the following but I lose the tabs above of course.
CODE:.................
View 2 Replies
View Related
May 22, 2010
I am trying to launch another application from my Activity. Something weird happens when I am running this code :
Intent myIntent = new Intent( Intent.ACTION_MAIN, null );
myIntent.addCategory( Intent.CATEGORY_LAUNCHER );
myIntent.setFlags( Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED );
ComponentName compName=new ComponentName(myArray[i][0], myArray[i] [1] );
// String[][] myArray myIntent.setComponent( compName ); startActivity( myIntent );
I have this error :
android.content.ActivityNotFoundException: Unable to find explicit activity class { com.android.settings/com.android.settings.Settings};
Have you declared this activity in your AndroidManifest.xml?
But when I replace this line
// myArray[i][0] = "com.android.settings" // myArray[i][1] = "com.android.settings.Settings" ComponentName compName=new ComponentName(myArray[i][0], myArray[i] [1] );
with ComponentName compName=new ComponentName("com.android.settings","com.android.settings.Settings");
And without any modification in my manifest, it works!
View 2 Replies
View Related
Aug 9, 2010
I am implementing a simple app. I need to start an activity based on the state of the Activity. Lets take i am using a button to start the activity.
1. If the activity is not started, I need to start XYZ activity.
2. If the XYZ activity is on focus, then i need to close the activity on the button press.
3. If the XYZ activity is not in focus (like onPause) state then, I need to change the button state.Can you please help me in the flags that i need to use for starting the intent. Is it possible to get the state of activity before I start that activity?
View 2 Replies
View Related
Jul 22, 2010
I'm not sure if this can be done, but is it possible to launch an activity from text that has been Linkified? I'm basically providing an illustrated glossary, and when the user clicks on a highlighted term, I want the activity that handles display of the image and associated text to fire up. I also need to pass in some parameters to the activity being launched.
View 3 Replies
View Related
May 6, 2010
I have a TabActivity that loads in 3 activity classes.In those Activity classes I have a button and an OnClickListener that tries to open a MapActivity class.I have searched to find an example of an Activity class launching a MapActivity class but cannot find one. If I swap out my MapActivity class with a Activity class it works.
View 2 Replies
View Related
Aug 24, 2009
I am facing a strange problem. I have 2 activities.The Second activity having the theme.Dialog (set in manifest). when I launched the second activity from first activity via startActivityforResult(). The Second activity is not Visible.
View 8 Replies
View Related
Jan 11, 2010
I want to List Item in Preference activity. and I want to launch a Browser with a URL which can change dynamically, When I click on that Item. Can anyone let me know how can i Achieve?
View 4 Replies
View Related
May 19, 2009
I am working my way through oh my first widget (so this is 1.5, obviously) and I'm stuck. I've poked around a problem involving the launch of an Activity when clicking on a widget. Scenario: User drags widget on home screen without prior launch of the Activity in question. I am following this post: http://android-developers.blogspot.com/2009/04/introducing-home-scree... Instead of launching the browser through ACTION_VIEW, I am trying to launch an Activity by class. I've toyed around with different Intent settings, but no luck.
View 7 Replies
View Related
Dec 22, 2009
I have written a widget that cycles through a series of movie poster images with next/prev buttons.This works.There is another button on the widget that needs to launch an external activity, sending it the name of the shown movie.The other activity is not in the same namespace, package or eclipse project as the widget.It is written by another developer and its apk is installed on my emulator.
View 7 Replies
View Related
Jan 22, 2010
I'm currently working with a two-activity application. The first activity allows the user to choose options for their upload, and the second activity displays a ListView of their results once processed.I have code in place that performs the uploads/downloads in the background, regardless of whether the application is currently in focus or not (thanks to Matthias Kaeppler's Droid-Fu).I would like to have my application Resume into my second (results) activity when a user clicks on the icon from the top-level launcher, regardless of how long they have been away from the app. I thought that the 'alwaysRetainTaskState' flag in the Manifest would do it, but I've not had success with that. Can anyone tell me how I need to set up my Manifest to get this functionality?
View 19 Replies
View Related
Feb 10, 2009
I am wondering if I am going about this problem the correct way.I am making an app that places overlays on top of google maps.When you click on the overlay it should launch a dialog type window that will give you options on what to do with that overlay.It is the line startActivity where the app throws an exception.I did the setFlags because an error message said it was needed because I was trying to start the Activity while outside an Activity.That makes me think I am going about this wrong.I have 'MyActivity' listed in my manifest so I don't think that is the issue.I have searched for this problem on the internet and I can't seem to find anyone else running into this so that is another reason I think I may be trying to do this the wrong way.
View 3 Replies
View Related
May 17, 2010
I am trying to make a task switcher and i succed in it. My only problem is that when I launch activities, they are relaunched as they were new activities ( for instance, I am writing an email, i press home and go into my activity,launch email, and then the app launch the email bout goes back at the inbox and the email is lost) So that's not true multitasking.
View 2 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
Jul 28, 2010
I've got two activities, one of them is called MyActivity. I want both of them to be able to use a function located in a class othat we may call MyClass. In MyClass, I try to use an intent to launch the activity AnotherActivity. Since the constructor takes a context as parameter, I simply tried to store a context from the activity in the constructor, and then use it when I try to create my intent.However, even thought none of the arguments are null (checked that with a simple if-statement), intent seems to be null and a NullPointerException is thrown. Why does it not work, and what can I do to solve the problem?
I'm quite new to Android and Java development, so please explain it as basic as you can.
View 2 Replies
View Related
Dec 17, 2009
I got a null pointer exception in an Activity onCreate() while trying to access my Application object (extended from android.app.Application).This exception occurred very rarely and i have no way to reproduce this again.My App starts a service on BOOT_COMPLETED intent and the null pointer exception seems to have occurred during boot up. Can somebody please throw some light on this issue? Application should have been created before creating any activities.
View 2 Replies
View Related
Jun 29, 2010
I would like to know if there is a way of preventing a duplicate launch of browser/activity, while the user is already focused on it.mybe there is a way to detect before if the user's current screen is already focused on the same activity/browser i intent to launch?
View 2 Replies
View Related
Jun 8, 2009
I m creating my own widget widget initial layout contains one button.when i click on that widget button it shud launch the specified activity using service everything is working fine..but the problem comes when there are 2 or more widget on home screen when i clicking on any one of them i m not able to specify with widget is launching the activity.
View 6 Replies
View Related
Jul 24, 2009
I've noticed some strange behaviour with resuming a task from a Home icon.Very easy to replicate, just create a new bare bones android project using eclipse, don't need to add anything. Then follow these steps:
1. In eclipse, Run the project on a emulator or device.
2. Once the app installs and launches the first activity, press Home key.
3. Launch the app again by pressing its icon.
4. Press Back key. Now this part seems wrong, you'll go back to the original activity in the stack, instead of the Home screen, even though its been previously launched and what you expect is it to bring back the stack as it was left, with one activity. If you repeat steps 2-3, it will just keep adding the same activity to the stack.
That is until you press Back all the way through the stack to the Home screen.Now this behaviour will never again replicate. It will be the correct (?) behaviour of bringing back the stack history at the state it was when Home was pressed. Note there are no behavioural modifications, this is just a default application. However, I tried many combinations of launchModes and stack clearing, they had no effect on the first run. Unless I'm interpreting the documentation wrong, when the user presses the Home key, the task is moved in to the background and simply brought back the next time they press the app icon? Why is the app icon altering the task it creates, if it already exists (with no flag modifications)?
View 3 Replies
View Related
Aug 10, 2010
See title for explanation.
Here is the method I'm using:
CODE:.........
And here is the call to the method:
CODE:...........
Why it would be throwing the "No Column Found with name=Test", although my DB explorer shows there is indeed a column named name and a value in a row named Test?
View 1 Replies
View Related
Aug 19, 2009
Our application is defined to launch a SplashScreenActivity from Intent { action=android.intent.action.MAIN categories= {android.intent.category.LAUNCHER} . After the SplashScreenActivity does its work, it launches another intent to launch MainMenuActivity and finish() is called on SplashScreenActivity.
When we run our app for the first time on our phone, the SplashScreenActivity launches OK, and correctly launches the MainMenuActivity.
However, if we kill the app using TaskKiller, LOGCAT indicates that the application has been killed. I can't debug the app, because launching it from eclipse with the debugger makes it work OK, because it reinstalls the app. Perhaps there is a way to launch the app without reinstalling it?
Here is the Log of us killing our app...
When we launch the application again, the LOG messages for SplashScreenActivity are not logged and it looks from LOGCAT that Android is launching the MainMenuActivity instead. Here is the log...
Can someone Romaine, Diane help us understand what is happening? We saw this happening because some variables are initialized in SplashScreenActivity that aren't available with MainMenuActivity and we were getting NPEs.
View 3 Replies
View Related
Jul 23, 2009
I have an activity that is showing a video and when the user clicks a button, a new activity is launched. When the video activity stops, I pause the video view. When the video activity starts up again, I try to resume the video view videoView.start(), however, the video starts over from the beginning. I'm thinking that the buffer must be lost somewhere, so I now try to capture the current position via videoView.getCurrentPosition(), however, this is always returning 0.
Anybody know how to resume video playback when an activity starts up again?
View 5 Replies
View Related
Apr 21, 2009
I have made a game with just one activity.. I just replace the views when I want to change screen. The game runs fine for a really long time inspite of what ever I do within the game.
But once I close the main game, by calling finish on the only activity in the application, and then when I start again, within the next 30 secs it crashes telling VM budget exceeded..
When I don't have a dispose() or a delete method in JAVA.. how the, am I supposed to remove the objects used in memory.. moreover I have android:launchMode="singleInstance" in my manifest
View 4 Replies
View Related
Nov 18, 2009
Notifications are displayed in status bar.Any thing, which appears to user in android is an activity. Thus can i assume status bar as an activity. Because user can see it. In that case there are always two activities in running mode ,one is home or any user activity and another is status bar activity. If that is the case we should have two activity stacks in android system one for status bar and another for home activity or any user activity. In my observation whenever a notification is received my running activity is not disturbed.And even it is not found in activity stack. Finally what i want to ask is can assume that there are two activity stacks in andriod system.
View 7 Replies
View Related
Sep 16, 2010
Can i create an activity with 2 status bar?
Can i put the status bar at the bottom of Activity?
View 1 Replies
View Related
Sep 22, 2010
I am trying to start an activity from the notification bar but it needs to get an int. From activity to activity I would just put an int into the intent but I can't seem to figure out where to add the extra for the notification bar? Is this possible? If not is there a better way to do it?public void notifyMe()Code...
View 1 Replies
View Related