I am using the Google Map's Places API's AutoCompleteSearchFragment
in a Dialog
. The error that I am getting occurs when I launch the dialog, close it, then relaunch it.
Error Message:
Error inflating class fragment. Caused by: java.lang.IllegalArgumentException: Binary XML file line #69: Duplicate id 0x7f0a0027, tag null, or parent id 0x7f0a00c7 with another fragment for `com.google.android.libraries.places.widget.AutocompleteSearchFragmet
My code:
Dialog alert = new Dialog(MainActivity.this);
alert.requestWindowFeature(Window.FEATURE_NO_TITLE);
alert.setContentView(R.layout.forgot_info);
alert.setCancelable(true);
alert.getWindow().setBackgroundDrawableResource(android.R.color.transparent);
AutocompleteSupportFragment autocompleteSupportFragment =
(AutocompleteSupportFragment) getSupportFragmentManager().findFragmentById(R.id.auto2);
The error also goes on to mention android.support.v4.app.FragmentActivity.onCreateView
and android.view.LayoutInflater.createViewFromTag
.
Is it possible that the duplicate id error is occurring because the Activity
believes that there is more than one AutocompleteSearchFragments
?
If so, how would I be able to delete or remove the AutocompleteSearchFragment
once the Dialog
is closed?