0

I am trying to develop an app that can take a snapshot of current location from Google map and send an email (All this by click of a button)

I would like to do this in the background.

Is this possible?

I was trying out:

http://goo.gl/krFqXu

But the above code supports FragmentActivity, I am developing the app extending an activity.

Is it possible to use the same code in extending an activity? if so how? I am getting error in the following place:

myMap = ((SupportMapFragment)getSupportFragmentManager().findFragmentById(R.id.map_pass_home_call)).getMap();
TheDevMan
  • 5,914
  • 12
  • 74
  • 144

1 Answers1

0

If your question is only "How to not use Support lib", you can do this:

myMap = ((MapFragment)geFragmentManager().findFragmentById(R.id.map_pass_home_call)).getMap();

The support library helps you to support devices with an old version of the API. It seems you don't need that, so every sample code you found on the web that is using the "support" library always have a simpler equivalent in most recent version of the API.

ben75
  • 29,217
  • 10
  • 88
  • 134
  • I have tried this I get "MapFragment cannot be resolved to a type" and what should map_pass_home_call have? – TheDevMan Jun 11 '14 at 09:49
  • Also my question is on how to use the fragment part on an java class that extends an activity? – TheDevMan Jun 11 '14 at 09:50
  • MapFragment is part of the GoogleAPIs : you must include them in your SDK – ben75 Jun 11 '14 at 09:50
  • I have imported google play service lib according the above link. I have included it in my project – TheDevMan Jun 11 '14 at 09:52
  • What should R.id.map_pass_home_call have? – TheDevMan Jun 11 '14 at 09:55
  • Figure out what should be there in map_pass_home_call.. but I am getting force close.. Attach log file. Please let me know where I am going wrong... http://txs.io/JBS Thanks! – TheDevMan Jun 11 '14 at 10:23
  • OK, this is not related to your initial problem. So here are my suggestions : if you don't understand the stacktrace read this : http://stackoverflow.com/questions/3988788/what-is-a-stack-trace-and-how-can-i-use-it-to-debug-my-application-errors then if after a lot of research you are still in trouble: read this http://tinyurl.com/so-hints and ask another question – ben75 Jun 11 '14 at 13:52
  • have you found a solution? – Andrey Solera Dec 07 '17 at 01:50