Android :: Overlay OnTap Not Working After Back Button?
Jul 29, 2010
I have several Overlays drawn on a MapView with ItemizedOverlay, and an onTap that works when I first start my app. However, if I press the Back button on the Android then start my app again the onTap does not work at all. Other touch sensative operations work fine, like long press on the map and several face buttons. It is also fine if I press the Home button on the phone then go back into my app, so its only on the Back button. It will also work if I first open another app like the Maps app, then go back into my app, acting like a reset.
Overriding the onBackPressed method to move the task to the background also does not work, does anyone have any ideas what would cause this? It happens in both the emulator and on a real device.
I don't know if it will help but here is the relevent code:
CODE:...........................
View 1 Replies
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
Feb 10, 2009
I am attempting to launch a dialog type window when I click an Overlay that has been placed on google maps. I thought the way I would do this was Override the onTap() method, create an intent, and call startActivity on that intent as follows:
CODE:..........
It looks like the program throws an ActivityNotFoundException when executing that last line. The exception reads that if you try to start an Activity while you are not in an Activity you need to set the FLAG_ACTIVITY_NEW_TASK flag which is why that line is there. I have included MyActivity in my manifest.
'context' is passed to my class constructor that extends Overlay and is the MapActivity that I am using to display the map.
View 2 Replies
View Related
Aug 30, 2010
I have an activity that has a button which opens a new MapActivity to select a location by tapping on the map.
The map has an overlay that overrides the onTap method to get the location but I want to return that location to the previous activity but, I don't know how to return the geopoint to the mapactivity in order to call the setResult() and finish() methods, because I can't call them from the Overlay.onTap method.
View 2 Replies
View Related
Aug 18, 2010
I like tu use the MapActivity to display some pins. When a pin is pressed i like to open a description. This can I obtain following the tutorial: http://developer.android.com /resources /tutorials/views/hello-mapview. But now I like to put a button on the overlay window. That button should open a detail activity. How can I make this? How is possible to personalize the overlay "info window"?
View 2 Replies
View Related
May 5, 2010
Could anyone help me with my below program. I'm unable to put a transparent label containing the contents from my HelloGoogleMaps.java class (Hola, Mundo!) when i click the markers(the android icon) in the map. I would like to have the ontap event do it for different markers here so that that particular location details is popped up. It needs to be in a canvas display. Upon clicking this new canvas label, it should take me to a seperate activity displaying complete details. I'm using the sample program given in the Google Android Website http://developer.android.com/resources/tutorials/views/hello-mapview and i want to extended it to the next level. Import com.google.android.maps.GeoPoint; import com.google.android.maps.MapActivity; import com.google.android.maps.MapController; import com.google.android.maps.MapView; import com.google.android.maps.Overlay; import com.google.android.maps.OverlayItem; import android.app.Activity; import android.graphics.drawable.Drawable; import android.os.Bundle;
View 2 Replies
View Related
Apr 9, 2010
I've implemented a Class that extends Overlay and also override the onTap / onTouchEvent (tried both). Right now it seems like that event is triggered when you tap on the map regardless of position.How can I make sure that the event is triggered only when you tap over the overlay you have added?
View 2 Replies
View Related
Apr 5, 2010
am new to this android development. I have index page and am displaying every links in the same page using div concept.Now i want to use the back button for my application i have developed code to handle the div and it is working in the AVD(Andriod Virtual Device 5556) but if i upload the apk into my device it is not working.
View 1 Replies
View Related
Apr 4, 2013
I update my Galaxy S2 SHV-E110S to JB but Menu and Back button not working.
View 1 Replies
View Related
Dec 19, 2010
I'm trying to create an always-op-top button/clickable-image which stays on top of all the windows all the time. The proof of concept is here URLs...I'm following this example code URL....
I have been successful and have a running service now. The service displays some text on top left corner of screen all the time while user can freely interact with rest of apps in normal manner. What I'm doing is subclass ViewGroup and add it to root window manager with flag TYPE_SYSTEM_ OVERLAY. Now I want to add a button/clickable-image in place of this text which can receive touch events on itself. I tried overriding "onTouchEvent" for the whole ViewGroup but it does not receive any event. How can I receive events only on certain parts of my always-on-top view group?
Code:
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.graphics.Canvas;
[code]....
View 2 Replies
View Related
Oct 27, 2011
I am currently working on an app and I want to lay a Bitmap over the Google Maps bitmap with the click of a button. I am assuming this is possible, and maybe a lot easier than I'm making it.
class MapOverlay extends com.google.android.maps.Overlay
{
@Override
public boolean draw(Canvas canvas, MapView mapView,
boolean shadow, long when)
[Code] ......
View 1 Replies
View Related
Jul 15, 2010
This is my first android device and i'm loving it... but one thing that irks me is the use, or lack thereof, of the back button.
As I am navigating menus and options in the Settings, I cannot simply go back one menu using the back key. For example, if I go to Settings->Battery Manager->Battery Profile Options and want to go back to the Settings screen, I cannot.
Pushing the back button does nothing and I can only go back to the Settings menu by going Home, then re-entering.
Another quirk regarding the back button is when reading emails. Using a regular email account such as Hotmail, I cannot simply read an email and go back to the inbox using the button.
It makes navigating the phone very tedious.
View 5 Replies
View Related
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
Mar 31, 2009
I call WebView.clearHistory(), but I am still able to go back after doing so. I want to reuse a WebView, but I don't want the back button to allow the user to go back further than the current "session" of using the WebView. Anybody know what is the best way to handle this? I thought for sure that clearHistory() would do it.
View 3 Replies
View Related
Oct 11, 2010
In my android application i have a video list screen,a buffering screen and a videoplayer screen.
As soon as the user clicks an item from videolist screen ,he is navigated to buffering screen and then to videoplayer.
In the buffering screen i am using Async task and doing the loading process in on background process.
Now my issue is like the user if has selested a video then gets navigated to buffering screen.But if the user clicks back when he is in buffering screen then initially he is getting navigated to videolist screen but immediately after that again he is navigated to videoplayer screen.
What i would like to have is either the back button should be made disable in buffering or should prevent the player tostart if back is clicked.
View 2 Replies
View Related
Jun 16, 2009
In My code I am displaying a AlertDialog based on some condition.
CODE:.......................
View 2 Replies
View Related
Jul 19, 2010
I'm finding that I'm using the back button A LOT whether browsing the web or just navigating the OS. It kind of sucks because the buttons on the droid x are well, really small, and sometimes hard to press because they are so narrow and flimsy feeling. And depending on how you are holding the phone, it could be a good bit of distance for your thumb to travel or I'm finding myself having to reposition the phone in my hands just to reach the back button, which you seem to need very frequently.
Anyone know of any kind of back 'swipe' implementation ? Like some software you can install that makes it if you swipe left to right on maybe the top bar it goes back?
View 4 Replies
View Related
May 5, 2010
Instead of trying to grab the notification bar and swiping it down, simply start ABOVE the screen and swipe down. Fast or slow makes no difference.
You can swipe it back up, or simply hit the back button.
View 15 Replies
View Related
Sep 8, 2013
In the last few days I am having to press the back button twice when using both the stock android browser and the latest version of chrome on my rooted S3.
View 4 Replies
View Related
Jul 26, 2012
My phone was working just fine and randomly the lock button stopped working and the home button brings up the power screen!
View 1 Replies
View Related
Oct 20, 2009
this morning when I wake up I realized that:
- home button is not working
- call button is not working unless you're into the contacts application (doesn't work from home page)
- Astrid application has lost all of the TODO tasks.
- It doesn't asks for the unlock graphical code!
It lost all of its battery yesterday night while surfing on the browser. My phone is an HTC MAgic Vodafone, using Android 1.6 Any ideas on how should i proceed? I soft reset the phone already.
View 4 Replies
View Related
Jan 4, 2010
On pressing the back button, I'd like my application to go into the stopped state, rather than the destroyed state. In the Android docs it states: not all activities have the behavior that they are destroyed when BACK is pressed. When the user starts playing music in the Music application and then presses BACK, the application overrides the normal back behavior, preventing the player activity from being destroyed, and continues playing music, even though its activity is no longer visible
How do I replicate this functionality in my own application? I think there must be three possibilities.
1) Capture the back button press (as below) and then call whatever method(s) the home button calls...........
View 2 Replies
View Related
Sep 1, 2009
Trying to the do as the title describes with the following code, but it doesn't seem to work. It just does nothing once i have altered the keyCode. Do i have to do something to the event?
..............
View 8 Replies
View Related
Feb 15, 2010
I'm using Google maps. I put the markers on map and my inherited ItemizedOverlay overrides onTap() method.
Markers are 32x32 images.
However, I can tap quite a bit away from the marker and still receive the event. This becomes a problem when markers are close to each other.
View 2 Replies
View Related
Jun 15, 2010
I have a MapView where I would like to be able to tap the map to create a new item at that location if there is no item there, or display the info about the item if there is.
I tried overriding both the onTap(int) and onTap(GeoPoint, MapView) methods but apparently if the second method is overridden the first never gets called (commenting one or the other lets each one work as I expected).
I thought about just checking if an item was at the location, but there doesn't seem to be any handy methods available to do that (other than iterating through the list of items and checking each manually).
View 17 Replies
View Related
Aug 3, 2010
I have an Overlays class named picOverlay which extends ItemizedOverlay<OverlayItem> that uses a drawable named ''overlay''.
I'd like for my application to change the drawable to let's say ''overlay_hover'' when the user touches the overlay.
Can I do this in the onTap method? Can someone enlight me a little bit on how to change the drawable that I'm actually touching?
View 2 Replies
View Related
Aug 28, 2009
I have a mapactivity with multiple ItemizedOverlays and a onTap method when the user clicks on the marker. I can show a toast message but i want to display a Dialog when the user clicks on the marker (so in onTap method). How can i do that?
View 2 Replies
View Related
Jul 15, 2010
I am a new to android development I want to override the default back button operation in android,please let me know how i can do this in code.
View 3 Replies
View Related
Feb 4, 2010
When I add a new item to my ItemizedOverlay the onTap display I have set appears X times, where X is equal to the number of items that I added. So for example, if I add one item and tap it, it the onTap method gets called once, and in the LogCat I get:
02-04 23:28:56.188: INFO/NotificationService(52): enqueueToast pkg=android.mapit callback=android.app.ITransientNotification$Stub $Proxy@4394c100 duration=0
If I add a second item and click ANY of the other items, the onTap method gets called twice and I get the following in LogCat:
CODE:.....................
If I add a third item and click ANY of the other items, the onTap method gets called three times and I get the following in LogCat:
CODE:...................................
Any idea why this would occur? I'm running into issues with it affecting other things like removal of items.
View 2 Replies
View Related
Jul 13, 2009
I looked for any information about onTap event processing for itemized overlays in this group. There is a lot of useful information but I could not find the answer to one question.
The tutorial by Mark Murphy on itemized overlays, http://androidguys.com/?p=1413
describes how to generate a Toast message whenever an onTap event occurs. In his case, the custom itemized overlay activity is included in the main activity. In my case, it is not. My custom itemized overlay activity is included in the application package as a public activity.
This means that the line Toast.makeText(NooYawk.this, items.get(i).getSnippet(), Toast.LENGTH_SHORT).show(); will not work "as is".
I have had trouble in correctly identifying the context for the Toast. Attempts to use the main class' (the one calling the custom itemized overlay class) context have not worked. I would appreciate it if anyone could suggest how I could resolve this issue. Incorporating the custom itemized overlay class in the main class is not a desirable option.
Alternatively, I would appreciate any suggestions for generating a display of the title and/or snippet information for markers on a map.
The onTap event works fine (Log.i statements in the onTap method display the correct information for each marker tapped)
View 7 Replies
View Related