Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid select from selectors then display on map
    text
    copied!<p>First screen user is ask to select different buttons that are categories then after the categories are selected display the locations in a map. </p> <p>For example user selects to search for restaurants and bars then click search. Then the next screen will show icons with the locations in the map.</p> <p>Im confused on how to pass the data from my mainActivity to the MapActivity. </p> <p>I try to do a loop for each button: but it displays all the buttons I only want to display the selected ones.</p> <p>----------------Activityone----------------</p> <pre><code>if (toggleButton5.isChecked()) { double point3=37326489; double point4=-121772461; Bundle b = new Bundle(); // create a bundle to pass to map activity b.putDouble("point3",point3); // bundle the geo points for the map activity and convert to 1e6 b.putDouble("point4",point4); Intent myIntent = new Intent(view.getContext(), Map.class); // create the intent to launch the map myIntent.putExtras(b); // attach bundle to map activity startActivityForResult(myIntent, 0); // start map activity //map things! } </code></pre> <p>----------------MapAcivity---------------- </p> <pre><code> Bundle b = this.getIntent().getExtras(); Drawable drawable1 = this.getResources().getDrawable(R.drawable.button_food_on); OverlayMap itemizedoverlay2 = new OverlayMap(drawable1, this); GeoPoint point2 = new GeoPoint((int)(b.getDouble("point3")),(int) (b.getDouble("point4"))); OverlayItem overlayitem1 = new OverlayItem(point2, "", ""); itemizedoverlay2.addOverlay(overlayitem1); mapOverlays.add(itemizedoverlay2); </code></pre> <hr> <p>Edit: first here is an image of the first screen:</p> <p><img src="https://i.stack.imgur.com/MIiti.png" alt=""></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload