Android :: ItemizedOverlay Adding Items And OnTap?

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.

Android :: ItemizedOverlay Adding Items and onTap?


Android :: ItemizedOverlay.onTap() Imprecise?

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

Android :: ItemizedOverlay Using Both OnTap Methods

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

Android :: How To Persist Options Selected In AlertDialog Spawned From ItemizedOverlay OnTap Method

Jun 7, 2010

In the description of how to add a list of options to an AlertDialog the official Android documentation alludes to saving a users preferences with one of the "data storage techniques." The examples assume the AlertDialog has been spawned within an Activity class.

In my case I've created a class that extends ItemizedOverlay. This class overrides the onTap method and uses an AlertDialog to prompt the user to make a multi-choice selection. I would like to capture and persist the selections for each OverlayItem they tap on.

The below code is the onTap method I've written. It functions as written but doesn't yet do what I'd hope. I'd like to capture and persist each selection made by the user to be used later. How do I do that? Is using an AlertDialog in this manner a good idea? Are there better options?

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

View 2 Replies View Related

Android :: Adding Items To ListView (Already Initialized)

May 31, 2009

After the listview is already initialized, is it possible to add items to it during runtime?

View 3 Replies View Related

Android :: Adding Items To Spinner Dynamically

Jan 29, 2010

How to add items to the spinner dynamically in android?

View 1 Replies View Related

HTC EVO 4G :: Adding Items To Calender?

Jul 21, 2010

Looking to use my Google calender to track my work places/what i did etc..

is there an easier way to ADD stuff to the calender? any cool programs/etc? been searching for a while and can't find anything that fits my liking. Lotta cool programs to display, but nothing neat to add stuff quickly.

View 2 Replies View Related

Android :: Adding ListView Items Dynamically - Force Close

Dec 11, 2009

I have an Absolute Layout with two buttons on top, a Text View of fixed size in the middle and List View as the rest of the Layout.

I want to use the top left button to add a list view item to the existing list and the top right button to remove the last item from the list. The List is layed out properly when the App starts, but as soon as any of the two buttons is pressed, the Activity Force Closes.

Here is the code:..................

View 7 Replies View Related

Android :: Adding Items To Maps Overlay Does Not Immediately Show On Map

Aug 28, 2010

I can't figure out how to tell my Map to redraw its overlays once I've updated them. Currently the user has to touch the screen before the map is redrawn.

View 2 Replies View Related

Android :: Adding Items To Data Source Doesn't Appear In ListView

Aug 29, 2010

I am adding items to my data source and would like it to appear in my ListView.

For some reason nothing is appearing:

Adapter:

CODE:.........

Adding items in onCreate:

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

Here is my layout:

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

View 2 Replies View Related

Android :: Adding Menu Items In WebView Context Menu

Mar 8, 2010

I'm trying to add custom menu items in a WebView Context Menu. Unfortunately, my items are shown in the menu of the first web page I load , but then if I load a second page, a long press only shows the standard context menu items. Mine are gone. I've put a Toast inside the code and it is displayed as well on the first loaded page, but not on the second. I'm using the code below:..............

View 6 Replies View Related

Android :: NinePatchDrawable As ItemizedOverlay

Jun 13, 2009

Is it possible to use "stretchable" graphic as pin in ItemizedOverlay? If not how can I draw NinePatchDrawable on Canvas?

View 4 Replies View Related

Android :: ItemizedOverlay ArrayIndexOutOfBoundsException

Jan 31, 2010

I've seen all the posts about using setLastFocusedIndex(-1).

I've tried that but my app is still crashing.

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

View 2 Replies View Related

Android :: NullPointerException ItemizedOverlay?

Nov 15, 2010

This does not refer to anywhere in my code at all.

How do I go about getting to the bottom of it?

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

Here is the draw method of the ItemizedOverlay

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

I now print out the stacktrace and no difference!

View 1 Replies View Related

Android :: Overlay Vs ItemizedOverlay?

Oct 24, 2009

I want to draw 20 pins on a MapActivity. Each pin has a small pin image, but I have to dynamically overlay a small bit of text over each pin at runtime.

Looks like I have two options:

#1) Itemized Overlay This is the suggested method. I put all my pins in one ItemizedOverlay object, and that counts as a single Overlay object for my MapView.

#2) One Overlay per pin Create a separate Overlay instance for each pin I need to render.

The problem I see with using method #1 is that you need to set a drawable for the item. This would mean that I need to create 20+20 (one for focused/non-focused state each) bitmaps and keep them in memory for the duration of my app. On the other hand, Overlay lets you override the draw method so I can do the simple compositing at runtime.

The other issue with Itemized Overlay - although it handles focus for you - does it move the focused item to the front of the z-order when selected?

View 2 Replies View Related

Android :: Displaying ItemizedOverlay(s) On A Map ?

Oct 31, 2010

I'm having some troubles with displaying ItemizedOverlay(s) on a map.

Here I extracted a simplified example of what I need to do.

Here's my Map class:

CDE:........

I followed the guide provided by google to extends the ItemizedOverlay class

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

As it is clear from the code I need to update at fixed times a map UI with possibly new positions to do so I'm using a timer, but I think I might fall in some kind of thread issues I don't know how to handle, since when running a test I can see in the Log what happens but no marker is drawn on the map.

View 1 Replies View Related

Android :: Change Drawable OnTap?

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

Android :: OnTap Start Dialog?

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

Android :: Increase Hit Detection On ItemizedOverlay

Sep 23, 2010

I have an itemizedOverlay extended and I want to increase the hit detection on the OverLayItem's if this is possible?

View 1 Replies View Related

Android :: Launching Activity From Overlay OnTap

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

Android :: Starting Activity In Overlay OnTap?

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

Android :: OnTap Display Toast Or Message

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

Android : Show Popup In MapLocationOverlay.onTap?

Oct 12, 2010

I'm trying to display a popup in a MapView. I m doing this in myLocationOverlay.onTap() method. I got the initial popup to display correctly. I have a button in the popup to expand the popup by making some hidden view visible and changing the height of the popup like this..

but the height of the popup doesn't seems to change. Am I missing something here?

View 2 Replies View Related

Android :: Problem Draw On A MapView ItemizedOverlay

Aug 27, 2010

I am developing an application for the Parisian Metro. One of the functions is a map where you can click the metro stations and see what are the metro lines, and when are the next 4 trains on this station.

I have hence created a MapActivity and an ItemizedOverlay classes.

On my device it is working perfectly, but I am getting some logs from the users with a crash, and I really don't understand what's wrong.

My map activity adds ONE ItemizedOverlay that displays a blue dot for the current user location. This overlay also listens to onTap, which depending on the coordinates of the tap, will try to find metro stations (for which I know the lat/lon coordinates). This is working perfectly.

The stack trace of the crash is:

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

Sometimes it comes from different lines but it always finishes crashing at OverlayBunde.java:42

As is does not mention my code, I don't know what's wrong.

You can get the source code of the MapActivity and the the ItemizedOverlay: http://code.google.com/p/metroparis/source/browse/trunk/src/org/bicou/metro/

The activity class is ACarteStations and the overlay class is StationMetroMapOverlay.

View 1 Replies View Related

Android :: Access Drawable Resources From ItemizedOverlay?

Jul 3, 2009

I have a method in my ItemizedOverlay class which takes an object as a parameter and depending on it's certain values returns an appropriate icon. What's the best way to access the drawable resource from within ItemizedOverlay as you can't access it directly like in an activity? The only idea I have for now is to pass the resources as a second argument...

View 3 Replies View Related

Android :: MapView With ItemizedOverlay Still Don't Work / Solve It?

Sep 7, 2009

I've try to make a mapview with itemized overlay and it's not work. I share my code if anyone see anything :

java class mapview code...

View 4 Replies View Related

Android :: OnToucheEvent Badly Handles ItemizedOverlay

Jul 6, 2009

I have the following exception that occurs I don't really know in which circumstances.

I'm just trying to add an overlay to may viewMap, and I don't have anything special in my classes. The most strange thing is that it worked for a while, then it broken again when I changed my image!

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

View 4 Replies View Related

Android : Way To Use 9-patch / Text For ItemizedOverlay On MapView?

Nov 23, 2009

In my application I would like to mark different spots on a map. What I'm now wondering is if there's a way to use a simple 9-patch image and add the spot's name as text to it or would I need to draw everything myself (including the text) in the draw() method of ItemizedOverlay?

View 1 Replies View Related

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 View Related

Android :: How To Scale Markers And Set Shadow And OnTap Correctly

Nov 17, 2009

I'm scaling markers on a MapView with the following code

CODE:.........

And:

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

Which works, but the shadow below the marker has wrong offset when scaled. Also; i override the public boolean onTap(int index) in ItemizedOverlay to detect taps on the markers, but it seems inaccurate. I can click some range outside the marker and still trigger onTap...

View 1 Replies View Related







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