Android :: Force A MapView To Redraw?

Mar 10, 2010

I've found that after changing the overlays on a MapView, the changes aren't seen until the user moves the Map, causing a redraw. Is there a way to force this redraw?

Android :: Force a MapView to redraw?


Android : Save / Activity With MapView And After Reload Same Mapview?

Jul 16, 2010

I had found a lot of stackoverflow post about save an Activity and the reload it.

My question: How can I have an Activity with an MapView and after reload the same mapview?

What is the best way to switch between activity and views?

View 2 Replies View Related

Android :: ExpandableListView Won't Redraw

Jul 29, 2009

I have an expandable list view with a static array for the group data and an SQLite database for the child data. It is implemented with the BaseExpandableListAdapter and works great, except, when I edit the database to delete or add children to the list I do not see the changes onscreen. It looks like I can use the registerDataSetObserver method to notify the adapter and expandable list of a data change. What I have to do in the callback to make Android redraw the list after data changes is what I need to know. Can I do it? Documentation on this part of the SDK is a bit sparse and expandable list view example code is not a good match. Can anyone offer advice on how to use a DataSetObserver? It feels like I have to switch over to a Cursor type adapter.

View 2 Replies View Related

Android :: SurfaceHolder.unlockCanvasAndPost() Does Not Cause Redraw

Sep 29, 2010

I'm implementing a fairly standard app with the Android sdk that involves drawing using the SurfaceView, SurfaceHolder, Callback setup.

In my main thread (UI thread) I have no drawing or handling of the SurfaceHolder (or the canvas you retrieve with it).

In a separate thread I have the following:

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

This code is being executed, throws no exceptions, and has no negative side effects that I can find; however, the unlockCanvasAndPost() call never causes onDraw() to be called.

In other words, unlockCanvasAndPost() does not cause a redraw of the SurfaceView.

Any ideas what could cause this symptom? I have plenty of java experience, a fair amount of android experience, and a lot of debugging experience and cannot track this one down.

View 2 Replies View Related

Android :: Getting View To Redraw When Parameters Change

Sep 20, 2010

I want to get a set of Views to redraw after I change some drawing parameters. I'm calling invalidate() and forceLayout() on the parent of the Views but nothing happens. If I rotate the screen then the Views redraw correctly using the new parameters, as you would expect. What else do I need to do to get the Views to redraw?

View 3 Replies View Related

Android :: Redraw Linearlayout After Clicking On Button?

Nov 22, 2010

I have a linearlayout that is filled with texviews dynamically when i click on a button , but the content of linearlayout doesn't appear, how can i redraw it?

View 2 Replies View Related

Android :: How To Redraw Only A Part Of My Custom View

Aug 14, 2009

I have a custom view, that overrides the onDraw() method. For better performance I want to redraw only a small part of Canvas in onDraw().

View 4 Replies View Related

Android : Get A Custom View To Redraw Partially?

Jun 1, 2010

I have a custom view that fills my entire screen. (A piano keyboard) When a user touches the key, it causes invalidate() to be called and the whole keyboard gets redrawn to show the new state with a touched key.

Currently the view is very simple, but I plan to add a bit more nice graphics. Since the whole keyboard is dynamically rendered this would make redrawing the entire keyboard more expensive.

So I thought, let's look into partial redrawing. Now I call invalidate(Rect dirty) with the correct dirty region. I set my onDraw(Canvas canvas) method to only draw the keys in the dirty region if I do indeed want a partial redraw. This results in those keys being drawn, but the rest of the keyboard is totally black/not drawn at all.

Am I wrong in expecting that calling invalidate(Rect dirty) would "cache" the current canvas, and only "allows" drawing in the dirty region?

Is there any way I can achieve what I want? (A way to "cache" the canvas and only redraw the dirty area?"

View 1 Replies View Related

Android :: Getting A RadioGroup To Redraw With Correct Button Checked

Oct 7, 2010

I have a RadioGroup view inside a LinearLayout. The radio buttons are added from dataList. If I call the code below from inside onCreate, the correct button is checked. However the dataList can get updated from time to time and after that happens I call this code again, without destroying the Activity. After that, the view is redrawn but no button is checked. I suspect the RadioGroup checked-button bookkeeping is getting confused by the removeAllViews call. Any ideas what might be going wrong?

View 6 Replies View Related

Android :: Animation Does Not Work Probably Screen Redraw Error

Apr 15, 2010

I have created a custom component in my program by extending a ViewGroup. This component listens to touch events and are supposed to start animations when the user has move their finger past some certain points.I'm able to start animations while the user is touching the screen. But I'm not able to start animations if the user doesn't move their finger. It's probably that the phone thinks it doesn't have to update the screen if the user isn't moving their finger.I added some logs and according to them the animation starts and ends but it doesn't draw on the screen. I have the same problems when starting an animation with a timer.I use AlphaAnimations and Translate Animations on ImageViews. I have tried to use invalidate() both on the component and the ImageView but it doesn't help.Anyone who has an idea how to solve this?

View 1 Replies View Related

Android :: How Does ImageView Just Redraw Part Of Its Content When Invalidate(Rect) Is Called?

Nov 8, 2009

I am new to Android development, just reading docs and trying the APIs. I am quit confused how ImageView managed to draw just a part of its content after an invalidate(Rect) invocation.

I've checked ImageView.java, found no other drawing method except onDraw(Canvas), but onDraw(Canvas) only cut the drawable only if it is beyound the view's visible boundary. I also read the implementation of View.invalidate(Rect), I think the key of this function is calling to mParent.invalidateChild(this, r);

However, I think the parent view doesn't know how to draw the child in the given Rect, it finally has to call some method of it child to paint out. Has anybody investigated this part of codes? Would you please give me some guide?

View 2 Replies View Related

Android :: Changing 9 Patch Background On List Item In Runtime Doesn't Always Redraw

Jun 1, 2009

I have a ListView containing a few different type of items, all having their own background image and font color. In my first implementation I implemented each type of item as its own layout with the background image etc defined in XML (and implemented Adapter.getView() so that it only reuses convertView if it's of the correct type). This works fine but the performance is not that great while scrolling since I'm inflating quite a few Views due to convertView mismatches, so instead I tried using the same layout for all items (to benefit fully from convertView reuse) and changing the background image and font size in runtime. I even keep the three background Drawables I need as members to save time decoding them from a resource for each item, and call View.setBackgroundDrawable() from Adapter.getView(). The problem is, sometimes the 9-patch is not correctly wrapped around the content of the list item when using this approach. While scrolling it usually looks correct but when the scrolling stops, or sometimes when I just tap anywhere on the list, the background 9-patch of some large items starts flickering and is either cropped or resized to its original PNG size rather than stretched to wrap the content.

First of all, I suspect this is a bug? Any ideas why this happens? Could it be that the View is not always measured to reflect the changed content when the 9-patch is applied? I have tried adding an extra call to View.invalidate() but it doesn't solve the problem. Second, does this approach sound reasonable at all, or how should I go about to optimize this scenario?

View 4 Replies View Related

Android :: Why Setting TextView.Ellipsize As Marquee Cause Its Sibling View In Linearlayout Redraw

Feb 3, 2010

We are using TextView's Ellipsize function to scrolling text in it and there many other controls in our window. We noticed CPU would go up to 50% if text started scrolling. After digging deeper, we found all controls in our layout kept drawing when texts scrolling. We wonder why? And how to avoid all controls redrawing?

View 8 Replies View Related

HTC Incredible :: Text Wrap / Redraw Buggy After Froyo

Sep 4, 2010

Has anyone else noticed that after updating to Froyo, that text wrapping/redrawing is not working properly while web-browsing?For example, if you go to a text heavy website, like Reddit, and I zoom in (either by double-tap or pinch), the text will redraw, but it will be slightly larger than the screen's width. To read the text, I am required to scroll a bit to the right, then back to the left, and so on.I never had this problem prior to the Froyo update. Can anyone else confirm that they are having this problem? before I get bombed on, I should say that I am very happy with Froyo in other regards. I have not had any battery drain issues or any lag anywhere. I did not do a factory reset.

View 2 Replies View Related

Motorola Droid :: Extreme Launcher Pro Redraw Lag To Homescreen

Aug 4, 2010

I was usind ADW for a while and liked it. I like LP better because of the scrollable bar bit when I hit the home key or back up to home, about 50+% of the time it takes ten seconds to redraw. I do ude widgets but it should not be this bad. In settings I tried keeping LP in memory, I set high mem useage and many of the other options and its the same. I even uninstalled wiped cache pulled battery and its the same. Is there a setting config I should be using, or not?

View 2 Replies View Related

OnDraw - Invalidate - Make It Redraw Only Newly Drawn Lines

Jun 23, 2012

I have a simple draw application on Canvas. User should be able to draw with a chosen color. On MotionEvent.ACTION_UP, invalidate() is called. Now it redraws previously drawn lines with the current color ( Redrawing the entire drawing with the current color). I do not want to change the color of previously drawn lines. I am not sure what is missing. Can I make it redraw only newly drawn lines?

View 4 Replies View Related

Android : How To Use MapView

Apr 16, 2009

I followed the steps in document to display MapView. But blank grid is displayed instead of google map. My code...

View 2 Replies View Related

Android : MapView In SDK 1.5

May 3, 2009

I've just downloaded the Cupcake SDK. I'm afraid I can't find MapView anymore...

View 5 Replies View Related

Android :: MapView Overlays

Sep 28, 2009

My problem is my MapView becoming very laggy and so non-responsive at times, that Android thinks its hit deadlock and tries to close it.

I am adding 60 overlays to the map view and i originally thought that the icon size may be causing the problem by using up all the memory. When i decreased the overlay icon size, it did improve things, though it is still to slow to be usable. Has anyone experienced anything similar and have a workaround? There may be a better way of doing it other then extending the Hello MapView example.

View 8 Replies View Related

Android :: Get MapView API In Droid?

Feb 17, 2010

How to get MapView API in android?

View 2 Replies View Related

Android :: Add Overlay To MapView?

Sep 28, 2010

I have subclassed Overlay as LandMarkOverlay (and implemented an onTap(GeoPoint) method).

In the main activity I do this:

setContentView(R.layout.main);

MapView mapView = (MapView) findViewById(R.id.mapview);
mapView.setBuiltInZoomControls(true);
landmarkOverlay = new LandmarkOverlay();

//add the landmarkOverlay to the list
mapView.getOverlays().add(landmarkOverlay);

What else do I need to do so that when the user taps the screen, landmarkOverlay's onTap(GeoPoint) method gets called?

View 1 Replies View Related

Android :: MapActivity - MapView?

Aug 25, 2010

I have a DROID using Android 2.2

I am attempting to get the simplest MapActivity to run on the device. (NetBeans latest and greatest using a Google Api build target.)

I have all the appropriate Manifest entries, the simplest OnCreate --- > all it does is setContextView() to the xml with a mapview in it.

View 4 Replies View Related

Android : Put Mapview In Tabhost?

Jul 24, 2010

I recently want to put mapview in tabhost but now is the question i can't figure out how to do this right!

here's my source code...

View 2 Replies View Related

Android :: Does OnTouchEvent Has To Extends From MapView?

Jan 26, 2010

I want to catch any onTouchEvent() on the mapview. After search lots of questions&answers, I found only when I write my own MapView(MyMapView)and define onTouchEvent, then use this MyMapView in main activity.

View 2 Replies View Related

Android :: Direction Information In MapView

Aug 16, 2010

I want to show the direction information in my app.Direction from one address to the another using Google maps and also wanted to set overlays at the starting address and the destination address.Is there any classes in android too do that.

View 5 Replies View Related

Android :: How To Draw 3D Objects On A MapView?

Oct 20, 2009

I have been able to draw a map using 'MapActivity' class. Am unable to render 3D graphics on the Map. Is there any way to draw something on the foreground with the Map as the background?

View 2 Replies View Related

Android :: How To Attach Custom Map On MapView?

Jul 9, 2010

I am trying to place my custom map (overlay) over Google map. For example, my MapView will be positioned to look at some building. I want to load custom image(s) that will show building's floor plan. Want to be able to pan and zoom, and place markers (for example, Room 1, Room 2, etc...), in other words, I would like to be able to use Google Map API methods. The best would be if Google map images are not loaded at all, since that will (I believe) slow down user's experience. Also, the user may be inside the building, and connection may be slow or non-existing.

View 4 Replies View Related

Android :: Is Runtime Mapview Defining Possible?

Jun 26, 2010

I've been trying to use a mapView in my app, and have been following the tutorial; http://developer.android.com/resources/tutorials/views/hello-mapview. Code...

View 5 Replies View Related

Android :: MapView Draw Overlays

Feb 14, 2010

i have a problem with my mapView. my app reads "some" gps points out of a file and i want to draw a route (drawing lines between the gps point). If my file contains many gps points, my app works really slow. i think its working slow, because i draw all overlays. now i want to check, whether a point is visible in my mapView or not. so i have to get the mapCenter and Lat/lon span (getLatitudeSpan,..) !? how and where must i save my points and how can i check all my points (after my mapCenter has changed for example). Shall I save my points in a list (in my Overlay class??) and iterate through every list item and check, wheter its visible or not?

View 4 Replies View Related

Android :: Dynamic Pin Overlays In MapView

Oct 29, 2009

I've been reading the (shoddy) documentation for the Google Maps API (MapActivity et al), and I think I have roughly worked out how it works. It seems that if you want to add a marker overlay you can use ItemizedOverlay easily, but you have to add all your markers at once. There doesn't seem to be any way to remove them.

What I want to do is query markers from an online database as the user pans around (in the same way the actual map tiles are fetched). Is there a simple way to do this?

As far as I can tell I need to subclass Overlay and implement the draw method, but where is the best place to put the code that fetches new markers when the map is panned? There doesn't seem to be an onMapChanged() method anywhere. My best guess is MapController.onKey() but that seems wrong.

View 2 Replies View Related







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