How To Arrange For Onnewintent()


I have two activities, the first accepts some user input and sets the second's configuration to do stuff. The droid way of doing this, correct me if i'm wrong here, is to set the configuration in the intent using putextra() and then override onnewintent() to pick up the new intent each time. Otherwise getintent() just picks up the original one.

The docs for onnewintent() say that you have to set the single top flag either in the receiving activity's configuration or in the intent itself. I faithfully do this, but i have never seen onnewintent() get called, ever.

Every time i run into this situation, i end up storing the configuration in some static singleton or something, but i want to do it right.


View Full Post With 5 Replies

Related Forum Messages:

Please Follow Index to Quick Jump to the Message.


Motorola Droid - Is There Any Way To Arrange Icons On The Home Screens

I got my droid yesterday adn so far thiungs are going smoothly however i have a few questions:

1. Is there any way to arrange the icons on the home screens?

2. When i send multiple messages is there a way to toggle between them all? I send a message adn when i get another one it usually goes to the last person i was texting.

3. My husband says i sound muffled on the other end, i read someplace that there is a way to change modes from sometihng like evg to evg-b (or is is egb-b) - where is it that i can chage this to see if it has different quality in the calls?


Posted On: Nov 7, 2009 2:31 PM . View Related Posts . . View 1 Replies .

Onnewintent() Is Never Called When Use Icons

What i'm trying to do was supposed to be very simple, but is not working. I would like to have 2 icons that will call my activity, that is the only one in the package. But, when the activity is called, i would like to know which of these icons was used.

In the logs, i'm able to see that the intent sent asap after press the icon is sending this message like:

Code:.

But, my override of onnewintent is never called and the onresume is receiving a modified version of the intent:

Code:.

As you can see, the alias1 packagename was modified to mainapp. And because of this, i'm unable to check which button was applied.

My code in the manifest file is simple:  

Code:.

As you can see, i'm using the singletop definition, as a requirement for onnewintent call. How can i have a way to check which icon was used to call my acitivity?


Posted On: Nov 14 2009 . View Related Posts . . View 2 Replies .

Activity Lifecycle - Onnewintent / Onsaveinstancestate

I have activitylanding which calls an activity called activityfolder. In the intent i used putextra("folderid", ". ")

(I know folderid is not the best example)

I can store that to a variable and use it just fine but if eventually my activity gets killed to save memory i may lose the folderid. When my activity gets launched again, will the "extras" from the intent get preserved? Will the code below work fine?

Code:.

If it does get preserved, then can i change it using asynctask and it still work fine?

Code:.


Posted On: Oct 2 at 21:10 . View Related Posts . . View 1 Replies .

Activity Inside Tabhost Not Getting Onnewintent When Searchmanager Dismisses

The documentation for the searchmanager says it will send an intent with the search string the user entered to the activity from which it was invoked. If that activity has set launchmode="singletop" in the manifest, the intent will come in through the onnewintent callback.

I have been unable to get this behavior when the activity was started by a tabhost. Instead of calling onnewintent, the activity's oncreate method is called, resulting in a new instance of the activity on top of the activity stack.


Posted On: 07-28-2010, 09:16 PM . View Related Posts . . View 1 Replies .