Android :: Launch The Same Activity From Widget With Different Extras - Prevent Same Instance Show Up After Returned From HOME Button?

Nov 5, 2010

I have a widget that contains 4 buttons to show 4 stock prices, each of them will launch into the same activity Quote.class to show stock details. In onUpdate(), it will set up the pendingIntent with extras with stock symbol. After I hit button A, it goes to Quote activity that shows stock A. Then I hit the BACK button to the homescreen, Quote activity calls onDestroy() and when I hit button B, stock B will show properly. However, when i hit HOME button after it shows stock A, the Quote activity only calls onStop without calling onDestroy(), then as i hit button B, it will call onStart() and it shows the same instance that shows stock A.

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

Originally I thought adding a flag in the Intent should solve this problem. But I have tried
i.setFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK or FLAG_ACTIVITY_NEW_TASK or FLAG_ACTIVITY_NO_HISTORY), none of them makes any difference.

So is there any ways to make it work? How can i remove the history stack from HOME button? How can I call onCreate in Quote activity and get new extras when i hit button B?

Android :: launch the same activity from widget with different extras - prevent same instance show up after returned from HOME button?


Android :: Trying To Launch Activity / When Home Screen Widget Is Pressed

Dec 20, 2009

I'm trying to do something which really ought to be quite easy, but it's driving me crazy. I'm trying to launch an activity when a home screen widget is pressed, such as a configuration activity for the widget. I think I've followed word for word the tutorial on the Android Developers website, and even a few unofficial tutorials as well, but I must be missing something important as it doesn't work.

View 6 Replies View Related

Android :: Launch Activity From Droid Home Screen Widget

Apr 24, 2010

I am desperately trying to get my head wrapped around how to implement home screen widgets. Right now, I (finally) was able to get a button on my widget respond to a button press setting up an intent filter in the manifest.

However, I cannot for the life of me figure out how to launch an activity when the button is pressed. Basically, here's the code i have...

What I really want to do, though, is start a new activity, not display a toast message. I know it has something to do with pending intents, but I can't figure out how to get that to work.

View 1 Replies View Related

Android :: How To Launch An Activity From A Widget And Return To Home Screen

Sep 14, 2010

I have a widget that when clicked opens an activity from same app as the widget. When the activity is closed/dismissed via a button, the user will see the full app window IF the app was previously open/in memory. Is there a way for the activity to finish and return to the home screen and not to an existing instance of the app?

Intent i = new Intent(this,RateIt.class);
i.putExtra("com.sporadicsoftware.NetQ.movie_id",aMovie.title_id);
i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET|Intent.FLAG_ACTIVITY_NO_HISTORY|Intent.FLAG_ACTIVITY_CLEAR_TOP);
PendingIntent pendingIntent = PendingIntent.getActivity(context,
0, i, PendingIntent.FLAG_UPDATE_CURRENT);
updateViews.setOnClickPendingIntent(R.id.movie_one_title, pendingIntent);

View 1 Replies View Related

Android :: Home Button On Samsung Galaxy Tablet Is Causing My Activity To Re-launch

Nov 22, 2010

On my droid phone, I get what I consider a proper pause/stop/resume/restart sequence when the home button is pressed and I then select my application. However, I'm testing on a new Samsung Galaxy tablet and when I select my application after having pressed the home button, a new activity is being launched. I do not understand why the behavior is different on the Galaxy. Any ideas? I have removed orientation config changes in the manifest, so it's not that.

View 1 Replies View Related

Android :: Home Button - Does Not Show The Last Activity

Jan 23, 2010

I'm experiencing kind of strange behavior of my application after hard Home button is pressed. When you press Home, everything is OK - my app goes to the background, showing Home screen. But if you try to choose my app in the main menu or in the list of last tasks it behaves like it was not started before and does not show the last activity you were on - it just starts from scratch, namely, shows the splash screen and starts next corresponding activities. Moreover, old activities of this app remain on the activities stack, and previous instance of the app is not terminated - so if you press Back for a few times you'll just run into those activities which were undoubtedly started during the previous session of work with my app. Splash screen activity is filtered by "android.intent.action.MAIN" filter and "android.intent.category.LAUNCHER" category. The strange thing is that all of that happens despite the fact that I do not intercept any Back key hits, or override any onPause or onResume methods. What's happening contradicts with my understanding of Android app lifecycle - I was sure that when you hit Home an app just goes to the background, and when you choose it in the menu later - it just unwinds and does not start anew. (Of course, unless stuff like that is stated in the app manifest or corresponding methods are overridden or something else). I also checked it for some other lifecycle events - such as changing orientation or flipping hard keyboard out - and none of those led to such strange results. It appears that the problem occurs when you try to start the app from main menu or menu of last applications.

View 1 Replies View Related

Android :: Prevent New Activity Instance After Clicking On Notification

Jun 24, 2010

Application (non-wanted) behavior - application is started, some text is put into text-box and notification is created through button action. user "clicks" the home button, application is "minimized", notification is available in bar user selects the notification and the application is "maximized"

BUT - instead of the original instance, new instance is started (e.g. in the newest instance is missing the original text; when the latest instance is closed there is still the original instance with original text ) .

The code of the notification method

CODE:.....

I have also in the manifest xml file following tag android:launchMode="singleTask"

But it is still the same...The main problem is double/triple initialization of the application, i know that there are other means to preserve the values in resumed applications. Also it is needed that the applications stays running in background as the main functionality is the streaming of internet radio.

What is missing in the code ? What kind of information from my side is missing for to troubleshoot the issue ?

View 3 Replies View Related

Android :: Prevent Multiple Instance Of Same Widget Being Added To Homescreen

Jun 4, 2009

I am learning the app widget programming in the 1.5 SDK release. I was playing with the sample widget (wiktionary) and found out that you can actually add multiple instance of the same widget to the home screen, is there a way to prevent this? An attribute in the XML? I am stuck with 3 instance of wikitonary and 2 instances of music player on my emulator now... can't get rid of them... :(Also I am looking into buliding my own app widget container, not a home screen replacement, just a container that can host other widgets, I read the appwidgethost api doc, is there any sample code or guide on how to use the appwidgethost api

View 3 Replies View Related

Android :: How To Show Up Animation At Activity Launch

Jun 22, 2010

i have a launcher activity which shows up the blank screen at the start up..i want to show up some animation using an animatd.gif...i initialize my layouts viz home etc when the oncreate of launcher is called, but how do i add some animated image until my first layout is shown..i also doubt whether android supports animated gifs or i have to do a workaround.

View 1 Replies View Related

Android :: Launch MultiTask Manager By Holding Home Button?

Jun 26, 2010

Is it possible to launch MultiTask Manager by holding home button..?

View 2 Replies View Related

Android :: Unable To Launch Widget To Home Screen

Oct 8, 2010

I am following http://www.helloandroid.com/files/xmaswidget/android_howto-hellowidget.pdf for developing a widget. I am unable to launch a widget on to the home screen.When running the application I am getting the errors like No Launcher activity found and The launch will only sync the application package on the device!

View 1 Replies View Related

Android :: Prevent Activity From Saving State When User Selects Back Button

May 2, 2010

I have an Activity with a list that is bound to a ListAdapter reading data into a ArrayList from a database. All is well when the data is first loaded. While the Activity is open and the list is being displayed it is possible and likely that the data in the database will be updated by a service but the list does not reflect the changes because the ArrayList does not know about the changes. If the Activity is no longer in the foreground as would be the case if the user goes to the home screen and then is brought back to the foreground I would like for the Activity to not display what it did prior but rather reload the data using the ListAdapter the view is bound to. I think something needs to call finish() but I am not sure what.

This is what I have in the Activity.

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

View 1 Replies View Related

Android : Droid Problem Quick Launch / Home Button / Bookmarks

Feb 17, 2010

this is my first post as a Droid user, coming from a BB Curve. Have had about a month with my Motorola Droid and am running into several problems that are a pain. 1. The phone seems to load the corp calendar, gmail, settings, messaging, alarm clock everytime I slide the phone to ON. I have gone into the Quick launch and turned off everything but it is useless. So how do I turn off the quick launches so I don't eat up so many resources. 2. The HOME button obviously has a mind of its own and usually take 3 or 4 touches before it activates and sends me back home. This is especially true if I am on-line or in my gmail. Has anyone else had this problem? Is there a fix or is this related to the resource issue? 3. Whenever I open one web site from my BM's it shifts the position of all of the other of my BM's. What is the use of a BM if the OS is going to bounce them around. Idiot design as for as I am concerned. I down loaded the app 'BookmarksBR' and it organizes my bookmarks in BookmarksBR but not in the browser. 4. Other than being slow at times I 'think' I like it better than the BB but jury is still out. Is there any word on OS updates.

View 1 Replies View Related

Android :: How To Control Activity Flow - Back Button Versus Home Button

Sep 2, 2010

I have 3 activities in my app: Activity1 -> Activity2 -> Activity3. Inside Activity3, if the user presses Back, I would like to return to Activity2. In Activity3's onPause event, I added a finish() statement. That's probably not even necessary, but I wanted to make sure this Activity gets cleaned up. This works fine.
However, while in Activity3, if the user presses Home or starts a new app (through notification bar or some other means), I want both Activity3 and Activity2 to finish. If the user returns to this app, he should resume with Activity1.

I have figured out how to do one or the other, but I can't figure out how to handle both cases, if it's even possible. Can I trap the "Back" button in Activity3 and send a message back to Activity2 telling it not to finish()? It seems like the Activities follow the same lifecycle flow (Pause, Stop) regardless of what you do to send them to the background. Just to answer the question of why I want this behavior, imagine that Activity1 is a login screen, Activity2 is a selection screen, and Activity3 is a content screen. If I press Back from the content page, I want to be able to make a new selection. If I exit via any other means (Home, notification bar), I want the user to be "logged out".

View 2 Replies View Related

Android :: Override Code That Launch Home Screen Activity?

Aug 3, 2010

Launch of My Activity at startup with out using Action_boot_complete. Instead of displaying home screen for the first time I want to display my activity for device setup when device_provisioned == 0. How can I override the code that launches the home screen activity.

View 1 Replies View Related

Android :: Launch Activity From On-screen Camera / Capture Button?

Feb 8, 2010

Is it possible to start an activity from the built-in Camera app after the user touches the on-screen Capture button?

View 4 Replies View Related

Android :: Widget Which Has Arrow Button To Show Up And Down

Oct 14, 2010

I am using a button to hide some edit text boxes and to display them, that means if I press a button 4 edit text boxex will scroll down and again if I press it that 4 edit text boxes scrolled down will scroll up and not visible, my problem is there any widget which has arrow button on that such that it can show scroll up and scroll down.

View 2 Replies View Related

Android :: Way To Catch Intent's Extras If Activity Is Already Running

Mar 4, 2010

I put a notification in the status bar with a PendingIntent (with Extras info) that points to my main app (main activity). When the user clicks the staus bar, the PendingIntent is fired and my app launches and I can read the Extras info in my onCreate() method. So far so good.

But if my app is already running, the PendingIntent simply causes the app to come to the foreground and it does not call any of my methods, so I can't read the content in Extras. What can I do?

View 1 Replies View Related

Android :: Home Button Not Resuming Last Activity

Sep 23, 2010

I am trying to solve an issue sort of similar to what was done here (link text)Except in my case where Activity A, started Activity B, started Activity C, when the user resumes the app after pressing the home button - I want C, the last Activity, to be displayed. Instead what is happening is I am back to A.Also on a side note I have discovered that even when I exit the application, if I hold down the Home button, my app is still listed as an active app even though in the LogCat I can see that it exited OK.Also, in case it matters, I did recently add android:launchMode ="singleTask" in order to make some notification logic work correctly. I was seeing the Home button behavior before that though.

Activity B actually has several Activities that it chooses from (it has a list of Intents) to display based on input it receives but launches them all the same way as Activty A launched B. Once the first Activity is displayed the user swipe the screen to navigate to the left or right screen. When the user swipes left or right, the current activity puts info in its return Intent that Activity B uses to display the next Activity. Also since logic outside of the user's control could prompt a change in the screen displayed, each Activty calls finish on itself in onStop to avoid back-button issues.

View 2 Replies View Related

Android :: DVM Instance Creation - Launch Installed Droid App At Runtime From Another?

Oct 14, 2009

I trying to understand how a new process is being created based on AndroidManifest.xml, also looking for the possibility of creating/ forking a new Java process/new DVM instance at runtime.

I could find that using Runtime.exec one can issue system commands or launch native applications, but this is not what I am looking for, I am looking for creating an equivalent java process just as the parent java process.

Can I launch an installed android application at runtime from another android application? Whats the way for doing this?

View 2 Replies View Related

Android :: 1.5 And 1.6 After Calling Finish Activity And Home Button

Jan 12, 2010

I open splash screen at the end i call finish() then i moved to browse page. At the browse page when i click on home button it hide the application.(b/c of Android's Multi tasking feature) When i go to Android's desktop launch application again it starts from splash screen. Android Platform 1.6

I open splash screen at the end i call finish() then i moved to browse page. At the browse page when i click on home button it hide the application.(b/c of Android's Multi tasking feature) When i go to Android's desktop launch application again it always starts from browse screen instead of splash screen why is that..............

View 1 Replies View Related

Android :: Unable To Start Activity - Load Home Screen Or Show Notification During Calls

Dec 18, 2009

Has anyone been successful showing a notification, starting an activity, or loading the home screen *during* a call on the Droid? All three of these actions can be done with the emulator running 2.0, but will not run from the Droid. I don't receive any type of notification that these actions fail on the Droid. Although, every action works when a call is *not* active. Missed calls during a call *do* show up in the notification bar, so I am hoping there is a way.

I understand that the notification bar can not be accessed by users during calls, but it would be nice if a notification could at least be delivered. I also understand the security and usability concerns of displaying a window or action during phone calls. Although, there are a lot of users who would like actionable functionality based on calls.

View 2 Replies View Related

Android :: Widget Instance On Homepage But The Widget Provider Or Receiver Is Disabled?

Sep 16, 2009

will the device wake up if there is a widget instance on the homepage but the widget provider or receiver is disabled?If I have a widget instance on the home page, but if I were to disable the widget provider from receiving messages by disabling the component, and if I have no components receiving the messages targeted for that widget, will Android still wake up the device?

View 5 Replies View Related

Android :: Use An Activity Or A Service When Using A Button In A Widget?

Aug 9, 2010

I have made a Android Widget which displays two articles (title + image). In addition to this, I have buttons for flipping backward and forward through the articles. What I don't understand is how I can change the Widgets RemoteViews when the buttons are pressed. Which should be one of the most basic operations in a widget, however, I can't seem to figure it out.

So... Can I do this with just a OnClickListener in the AppWidgetProvider? Or do I have to create an Activity without a window (visibility = false)?

View 1 Replies View Related

General :: Show Certain Part Of Webpage In Widget On Home Screen

Oct 9, 2013

Is there any way to display a certain part of a webpage in a widget on home screen with a manual (or auto) refresh button to sync it with the website?

For example, I have the following website and want to only show the table I circled in red on my home screen.

Code: [URL] ......

View 3 Replies View Related

Android :: Exit Current Activity To Homescreen (without Using Home Button)?

May 3, 2010

What I am trying to do is emulating the "Home" button which takes one back to Android's homescreen. So here is what causes me problems: I have 3 launcher activities. The first one (which is connected to the homescreen icon) is just a (password protected) configuration activity. It will not be used by the user (just admin) One of the other 2 (both accessed via an app widget) is a questionnaire app. I'm allowing to jump back between questions via the Back button or a GUI back button as well. When the questionnaire is finished I sum up the answers given and provide a "Finish" button which should take the user back to the home screen.

For the questionnaire app I use a single activity (called ItemActivity) which calls itself (is that recursion as well when using intents?) to jump from one question to another:

Questionnaire.serializeToXML();
Intent i = new Intent().setClass(c, ItemActivity.class);
if(Questionnaire.instance.getCurrentItemNo() == Questionnaire.instance.getAmountOfItems()) {
Questionnaire.instance.setCompleted(true);
} else Questionnaire.instance.nextItem();
startActivity(i);

The final screen shows something like "Thank you for participating" as well as the formerly described button which should take one back to the homescreen. But I don't really get how to exit the Activity properly. I've e.g. used this.finish(); but this strangely brings up the "Thank you" screen again. So how can I just exit by jumping back to the homescreen?

View 2 Replies View Related

Android :: State Of Activity Saving When Home Button Pressed

Oct 24, 2009

I am having an issue related to home key . when i press home key all current activity gets hidden. but when i press the executable it again starts from the fisrt screen . I have overidden all methods nsaveInstaceState opPause onStop onResume

but there are still issues what is the right way to handle those conditions. When i am pressing home button i am storing the widgets state in database and when i again click the exectable i am checking the database state and starting the new Intent as saved when user presses the home button .Is it the right way to do that as i am facing the problem when user does the same and again presses the back button , there is already on intent available in stack of activity .

View 2 Replies View Related

Android :: How To Close An Activity When User Clicks On Home Button

Feb 19, 2010

I understand that trying to capture home button clicks is a hack, but I need to atleast close my current activity when the user clicks on home button. Is there anyway I can tell the system to close this activity is the user clicks on home button? If so how can I do that? I need to do it as I am listening for location updates and I want to stop the updates and also need to trash any location that was available to me previously. I need to do this just in case any user while in that activity clicks on home button and changes the location settings.

View 7 Replies View Related

Android :: How To Get Calling Activity Instance From Called Activity?

Jul 9, 2010

I have a Contact Activity which is derived from ListActivity, which displays list of contacts, and on click of item, a new Activity Message Activity derived from ListActivity is initialized.Now I know, I can pack some information in Bundle and pass it before creating activity, but is there a way I can get instance of "ContactActivity" in onCreate method of "MessageActivity"?

View 1 Replies View Related

Android :: Activity State On Pressing Back And Home Button On Screen

May 6, 2009

Whenever I press the home button when Im in the root task of my application and when I click on the icon of my app again the state of my task (activity) is retained, but when i press the back button on the emulator and when I open my application its state is not retained. I want the state to be retained in both the scenarios.

In the mnifest I have given the below entries,

android:alwaysRetainTaskState="true" for the root activity

android:launchMode="singleTask" for the application

View 2 Replies View Related







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