Android :: Android - Single Top - Launch Mode And OnNewIntent Method
Nov 10, 2009
I read in the Android documentation that by setting my Activity's launchMode property to singleTop OR by adding the FLAG_ACTIVITY_SINGLE_TOP flag to my Intent, that calling startActivity(intent) would reuse a single Activity instance and give me the Intent in the onNewIntent callback. I did both of these things, and onNewIntent never fires and onCreate fires every time. The docs also say that this.getIntent() returns the intent that was first passed to the Activity when it was first created. In onCreate I'm calling getIntent and I'm getting a new one every time (I'm creating the intent object in another activity and adding an extra to it...this extra should be the same every time if it was returning me the same intent object). All this leads me to believe that my activity is not acting like a "single top", and I don't understand why.
To add some background in case I'm simply missing a required step, here's my Activity declaration in the manifest and the code I'm using to launch the activity. The Activity itself doesn't do anything worth mentioning in regards to this:
in AndroidManifest.xml:
code:.........
in my calling Activity:
code:.............
View 2 Replies
May 23, 2010
I have just written a game for the Android market and would like to remind my customers to leave feeback on the market for the application (especially the demo version.) Is there any way to launch the market intent in a mode that will take the user to the feedback / comments section of the page?I already use this approach for linking my demo to the paid app.
Is there a best practice that any Android devs out there might know of?Additionally, is there any way to track referalls from my demo app so that I can try to calculate some kind of a conversion rate? (i.e. how effective the demo app is at generating sales.)
View 2 Replies
View Related
Jun 1, 2010
I have two activities: a MainListActivity, and a DetailViewActivity. DetailViewActivity is set with android:launchMode="singleTop".
When clicking an item in the "main list" activity, it launches the "detail view" activity via:
startActivityForResult(detailIntent, REQUEST_CODE_DETAIL);
If I then call setResult(RESULT_OK, resultData); and finish(); from within the Detail activity, that resultData is received by the "main list" activity's onActivityResult(..) method correctly.
However, if I implement a "see previous"/"see next" type of navigation within the Detail activity, and implement it using singleTop, that result no longer gets sent back to the initial activity:
Intent nextItemIntent = this.createIntent(nextId);
nextItemIntent.setFlags(Intent.FLAG_ACTIVITY_FORWARD_RESULT);
startActivity(nextItemIntent);
// at this point, my DetailActivity's onNewIntent() method is called, and the new data is loaded properly
But from here, when I call setResult(..) and finish(), my MainList activity never receives the new/updated result. Anyone know what I'm doing wrong?
View 1 Replies
View Related
Oct 1, 2009
What are advantage and disadvantage of applying android:launchMode="singleInstance" in the android.manifest file. Will it hamper the services in the application? And how is it related to the performance of the application?
View 2 Replies
View Related
Sep 17, 2010
I have been trawling through many different forums and cannot find anywhere that tells me how i launch "Car Dock Mode", does anyone know how i get this to launch on my Desire? I have a non branded Stock HTC Froyo Rom installed (Non Rooted). Any help anyone can give me would be fantastic as I am going down to Bournemouth tonight and could do with this in the car.
View 1 Replies
View Related
Jul 6, 2012
How to set up my Htc Sensation to auto launch the car mode when it connects to my Bluetooth headset. I've seen apps like tasker but I don't know how to use or configure it.
View 3 Replies
View Related
Sep 23, 2010
To start, I'll say I've done much searching on my question, both on this forum and others. Plus, I've searched AppBrain using many parameters to no avail.So, that little disclaimer out of the way....I have a DX. My last device was the original Droid. After the upgrade to Froyo on my original Droid, I noticed two really cool and, for me, useful dock functions that do not work with the Froyo upgrade on my DX. Original Droid (w/Froyo): When I would put the Droid in the car dock, there was a nice little icon that said EXIT. Meaning it would go out of car dock completely when you touched it. Even the icon in the top bar would go away. Also, when I hit the home button, say out of Navigation, it would take me to my regular home, vice back to the car dock home. I LOVED this, as I dislike and do not use the car dock mode ever. This icon is non-existent on the Froyo car dock mode on my DX. Next. Again, original Droid (w/Froyo. and I state this because with Eclair, these functions were not there): When plugged in for the night, I would touch my Retro Clock app widget, and (I don't know why, it just did) it would launch the Home Dock screen. (with weather, music icon, etc...) Now this I LOVED also, as I could set my alarm, check the weather where I was at, and even get some news headlines before going to sleep. Plus, it would then go into screen saver mode, dimming the screen nicely. I would like very much to get this kind of functionality back in both instances. Does anyone have any ideas for apps that would kill the car dock mode completely, either permanently, or at least every time I put it in the car dock?And is there some way to launch the home dock mode while in the car dock?I am a truck driver, and the car dock is where I put my X to charge at night.
View 1 Replies
View Related
Nov 8, 2009
I bought the car dock and it has served me well thus-far, but I don't really see a reason to plunk down the cash on the home dock. It's nice, but I don't want to buy it right now. However, I do very much like the display that appears when it is docked. I can't find a way to launch this without the dock itself, and I'm certain there has to be a way. What am I missing?
View 10 Replies
View Related
May 9, 2010
I was wondering if there's a way to change default input options for portrait and landscape modes independently? I like using swipe for portrait and full keyboard for landscape and its kinda annoying to keep changing it every time.
View 3 Replies
View Related
Feb 24, 2010
What is the best way to launch an app and calculate its launch time in android(if it can be done with some code,then its better)
View 2 Replies
View Related
Sep 7, 2010
I'm trying to override the onBackPressed() method of the ActivityGroup class:
public class MyClass extends ActivityGroup {
@Override
public void onBackPressed() {
// do something
return;
}
but I'm getting the error The method onBackPressed() of type MyClass must override a superclass method. I'm relatively new to Java, I've seen here that people do it and it works for them Why I'm getting this error? I'm writing an app for android 1.5, could the problem be here?
View 1 Replies
View Related
Nov 22, 2010
In Eclipse, when I mouse hover over a built-in method, it displays a method definition including stuff like what the method does, input objects, return objects etc. If I have a yellow line (warning) under the method I'm trying to use, I can't get the mouse-over to show the definition. If I try hitting F3, I get a "The Jar of this class file belongs to container "Android 1.6" How do I show the definition of the method I am using when there is a warning?
View 1 Replies
View Related
May 12, 2010
I am trying to use annotation - method.getAnnotation( ) or method.isAnnotationPresent( ) and it is not working. I am using eclipse emulator for 2.1 OS version with JDK 1.6. Following is information about what I did..................
View 4 Replies
View Related
Nov 1, 2010
I created a method called insertTable in a class called Table but i can't use it in my onClick method in the main class :
CODE:.......
I want to do a income.insertTable in the onClick method but eclipse say that i need to create a local variable.
View 3 Replies
View Related
Feb 27, 2010
I have two android projects, ProjA requires ProjB (in Eclipse Properties > Java Build Path > Projects > Add > ProjB). Every thing compiles ok in Eclipse, but when I run ProjA I get an error: Could not find method XXX, referenced from method YYY. Where XXX - is the method from ProjB. How can I fix the settings?
View 3 Replies
View Related
Aug 28, 2010
the title say it all. I wanna know a corresponding method in Android/Java that is like the GetTickCount method in C#/C++?
View 1 Replies
View Related
Jun 6, 2010
Basically I'm calling the onDraw method like so...
code:...................
You see I'm drawing it on top of a Camera view and the information being drawn is subject to change. I have a listener setup which will update the variables being drawn at the appropriate time but I now want to "refresh" this draw in that listener.
View 1 Replies
View Related
Sep 15, 2010
Why should a static method in java accept only final or non final variables within its method, but not static?
For example I have the following method:
CODE:.................
View 6 Replies
View Related
Aug 23, 2010
I'm working on adding a calibration feature to an accelerometer-driven game. For the calibration, I need a single value from the accelerometer. Should I register a listener, get the first value it gives me, and unregister it, or is there a better way to get just one value?
View 2 Replies
View Related
Jul 30, 2010
I want to display the images one by one that means first i am displaying the some (5) images in a single row.when i am track that view next pair is coming.and when i click on particular image that image will be dispayed as big image in layout which is above of this single row layout.For this which layout are useful that means grid view like that.Give me some suggestions.
View 2 Replies
View Related
Sep 25, 2010
Is there an app out there where you can pick any number of football games to keep upto date with the score with, on a single screen?For example, I put a number of bets on a Saturday afternoon and I would like a to be able pick which games I have bet on and have them auto update on one screen?If anyone knows of a website/ipad app where this is possible please let me know!!!
View 1 Replies
View Related
Feb 27, 2010
I'd like to make a listview that used the ListView.CHOICE_MODE_SINGLE so that the user could only select one thing at a time. However, I want the background to change to the focused color when selected, rather than a checkbox checking off. A good example of what I'm trying to do would be basically any file browser, where the background changes color on each item you select in sequence.
View 1 Replies
View Related
May 9, 2010
How does android make single app execute on multiple hardware devices. Does the Manifest have elements like screen size, resolution, CPU architecture etc?
View 2 Replies
View Related
Sep 16, 2010
Is there a way to force GridView to only be a single row? Right now by default it will extend its height to accommodate all views supplied by its adapter
View 1 Replies
View Related
Feb 3, 2009
I need to have 2 launcher activities (i.e. 2 icons on the home screen). Each launch icon would launch a separate activity. Essentially, I need a single apk which contains a suite of 2 apps which I don't want to distribute separately. Is this possible?
View 6 Replies
View Related
Mar 14, 2009
Thanks for your reminding me of that. JBQ. From the reference of SDK, AlertDialog information as below. I want to create a dialog but I don't want to have any buttons in the dialog, then I hope to dismiss the dialog after i click any item in the dialog, how should I dismiss the dialog? When the user click the "back" button, it will dismiss the dialog. So I need to send the key message in hard code? is there any other way?
public AlertDialog.Builder<http://developer.android.com/reference/android/app/AlertDialog.Builde...>
setSingleChoiceItems (CharSequence[]<http://developer.android.com/reference/java/lang/CharSequence.html>items, int checkedItem, DialogInterface.OnClickListener
<http://developer.android.com/reference/android/content/DialogInterfac...>listener)
Set a list of items to be displayed in the dialog as the content, you will be notified of the selected item via the supplied listener. The list will have a check mark displayed to the right of the text for the checked item. Clicking on an item in the list will not dismiss the dialog. Clicking on a button will dismiss the dialog. Parameters items the items to be displayed. Checked Item specifies which item is checked. If -1 no items are checked. listener notified when an item on the list is clicked. The dialog will not be dismissed when an item is clicked. It will only be dismissed if clicked on a button, if no buttons are supplied it's up to the user to dismiss the dialog.
View 5 Replies
View Related
Mar 29, 2010
In the application I am working on now I came up with the following problem. I have list view which is displaying items with images in most cases it will be different image for different items (thumbnails about 60x60 pixels). So the problem is how can I handle image processing for the view. For know I have the following variants:
1. I can cache all bitmaps and when I try to display view I get bitmap from cache synchronously and display it. The problem is that 60x60=3600x4=14kb per bitmap which is waste of resources.
2. When I need to display view I can register event to some thread to decode the associated bitmap which will decode it in background and than to update gui. This sounds good for me the scrolling is still smooth because all image processing is done in background. Updating list view is bit jerky for now I am doing it view notifyDataSetChanged which is updating all visible views although I can update thumbnail for a single item.
So question one is is there better way the update single listview element than calling notifyDataSetChanged.
View 2 Replies
View Related
Aug 18, 2010
I would like to animate a view I have to appear like it was sliding off the screen to the left, and then sliding back to the screen from the right. I've set the duration of the first and the start Off set of the second as 1000, so the second should start right after the first ends. Instead I get their order reversed and I see my view sliding from right into the screen, and then sliding off the screen to the left. Reversing the animations order didn't do anything. Anyone got a clue why is this happening, and how can I do what I want?
View 3 Replies
View Related
Oct 13, 2010
I dislike G Mail because of the threading and it is SLOW but it would appear to be the only email client on android that can forward html so I'm stuck with it. How in the world do you delete an individual message of a conversation without deleting the entire conversation? When I expand a conversation, the messages have reply, reply all and forward at the bottom of the message but no delete. The delete button at the bottom of the screen (between archive and older) only wants to delete the whole conversation. What am I missing?
View 2 Replies
View Related
Jun 2, 2010
I'm new to this forum. I tried searching for the answer on both Google and multiple forums but the key words of 'Stop, app, update, notifications' tends to find a lot of hits or none at all if in quotes. I found this question posted perfectly at the droid forums.net but with no answer so I thought I would post it here with the hope that someone can find an answer.
View 2 Replies
View Related