I'm trying to develop an app which has two editText fields for entering location. So I made two java files
1.MapsActivity.java
(with activity_maps.xml
)
2.AutoComplete.java
(with autocomplete.xml
)
In MapsActivity
while clicking the 'from' text field, it will open the AutoComplete
activity and after clicking any of the suggestions in it will open a fresh MapsActivity
and places the clicked item . Likewise for 'to' text field also.
I am using Intents to pass the clicked values. So at last, five activities are opened when the two text boxes are filled. When I click back button ,it is showing the auto complete activity used the previous time.
Question:
Is any other way to close a particular activity with same name running behind?
Is there any other way to pass values by
super.backpressed()
; ?