Android Google Maps tiles not loading on "back" button click -
i have android application uses google maps. first activity starts mapview clickable icons. when icon clicked, new activity (intent) started different map. new map click button takes me first map. however, when start zooming or moving around in map, tiles loaded show up. how can change this?
if change phone orientation map refresh , behaves (becuase app restarted) added android:configchanges="orientation" stop restarting on orientation change. added because don't want reload markers again (uses web service , can take time).
i want tiles load when click "back" original map. ideas?
i ran problem well! check log - you're getting error along lines of "illegalstateexception: connection pool shut down." me, answers found seemed people hadn't set google api key right. :-\
i ran this link. (you need signed in google account read these posts)
it appears though there's bug allows 1 map activity per application. map refreshing, guess. got around finishing each map activity after loading new one, causing activity reloaded in entirety when user returns it. it's not ideal, it's worked me far.
in more detail:
save information map want retrieve later. map center , map zoom first come mind. put somewhere global, or pass in intent.
after launching intent second activity, call finish() on first one. if want 2 maps appear user same map, you'll want kill sliding transition occurs default when new activity started. calling line after finish():
overridependingtransition(0, 0);
when second map activity needs finish, repeat step 1 if needed , load first map activity using same method step 2. code 2 go in onbackpressed() method of activity, , wherever else appropriate (maybe have cancel button or something).
in oncreate of first activity, make sure check stuff that's been saved last time activity being viewed , modify map appropriately.
maybe verbose, use site lot , appreciate answers lot more ones little, haha!
Comments
Post a Comment