aspose file tools*
The moose likes Android and the fly likes street view & satilite view is not working Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Android
Bookmark "street view & satilite view is not working" Watch "street view & satilite view is not working" New topic
Author

street view & satilite view is not working

sam liya
Ranch Hand

Joined: Nov 25, 2008
Posts: 1225
this is my main class

this is working fine.i have added a button to change the view.there are two buttom to change the street view and satilite view.But it is not working.???
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
Compare lines 173 and 176.
sam liya
Ranch Hand

Joined: Nov 25, 2008
Posts: 1225
what is the error wit h lines 173 and 176 ?
it is trigger only button clicks.
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
Do they actually do that? Both of them?
sam liya
Ranch Hand

Joined: Nov 25, 2008
Posts: 1225
I have change the code.still same.


Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
Have you ascertained that those "if" conditions are triggered? In other words, do the mapView.set... methods get executed?
sam liya
Ranch Hand

Joined: Nov 25, 2008
Posts: 1225
I need to change the map view after load it into phone.normally google map load normal map.i need to change the type of map after clicking the button.
So how it should be change?
sam liya
Ranch Hand

Joined: Nov 25, 2008
Posts: 1225
I have change the code.Still same.

Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
Tim Moores wrote:Have you ascertained that those "if" conditions are triggered? In other words, do the mapView.set... methods get executed?

Does that mean the answer to this question is "yes" or "no"?
sam liya
Ranch Hand

Joined: Nov 25, 2008
Posts: 1225
Yes.
It should be called,because have change them inside the onclick method.Then button clicks it must be called.

Anyway I have change the code as below.Same reqult.


Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
I didn't ask whether it *should* be called; obviously you think that it should. I asked if it *is* getting called. That's what matters, and that's what you need to find out.
sam liya
Ranch Hand

Joined: Nov 25, 2008
Posts: 1225
I tried with debugging.But never gones to that method.I don't know why ?
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
Is it called for the copyrights button? If so, what's the difference between that button and the other two buttons?
sam liya
Ranch Hand

Joined: Nov 25, 2008
Posts: 1225
Yes.copyrights button working.So do i have to call separate activities for each street & satalite views ?
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
Separate activities? No. But you will have to register the onClickListener with all buttons for which it should be called.
sam liya
Ranch Hand

Joined: Nov 25, 2008
Posts: 1225
Thanks Tim.It is working fine.Anyway When i moves with phone The pointer doesn't move.I have to rstart the programm.What is the error with that ?
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
What do you expect to happen? It's not like the onLocationChanged method causes anything to happen.
sam liya
Ranch Hand

Joined: Nov 25, 2008
Posts: 1225
I need to change the poiter with the current changes.Example it i travelling in a vehivle pointer must be change with the location changes.
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
Sounds like you need to tell the MapView to update itself somehow.
sam liya
Ranch Hand

Joined: Nov 25, 2008
Posts: 1225
There is a built in application in my phone which changes the pointer when i move with phone.

anyway can't we do this using this code.

locationManager.requestLocationUpdates(bestprovider,5000, 0.2f, this);
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
anyway can't we do this using this code.

Why not? I sounded like that's what you wanted to do.
sam liya
Ranch Hand

Joined: Nov 25, 2008
Posts: 1225
I change the code as below.


So i reduce the time different.but still it is not update the pointer when i moves in a vehicle .
Where is the error ?
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
Tim Moores wrote:Sounds like you need to tell the MapView to update itself somehow.
sam liya
Ranch Hand

Joined: Nov 25, 2008
Posts: 1225
So that means i have to repeat calling below code for location changes.



Is it ok to do all above code in onLocationChanged method.I think it is better .because it automatically calls that method when location chnages happen.isn't it ?
sam liya
Ranch Hand

Joined: Nov 25, 2008
Posts: 1225
I have change the code adding while loop.


But the problem is now code never goes to if part as lastknownlocation null at first time.Can anyone give me solution for this ?
Is there a way to get currentlocation details without lastknownlocation method ?
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
You can't loop forever on the onCreate method - you need to return from that quickly, live you would do for all other lifecycle methods. Any GUI changes should be triggered from the various listeners, like onLocationChanged and onClick.

I don't understand your question - why does the code rely on there being a lastknownlocation? There won't necessarily be one, as you have found out. Nor will there be a currentlocation until you get onLocationChanged updates. You will need to decide what the app should do until there is a currentlocation.
sam liya
Ranch Hand

Joined: Nov 25, 2008
Posts: 1225
k.But i mean if the location changes countinously it automatically calls the onLocationChanged.So if i need to show it on the map i have to call below code coutinously.So is it correct to code below one in onLocationChanged activity ?



 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: street view & satilite view is not working