public class LNIterativeSearchIntentBuilder extends IntentBuilder
LBIterativeSearchIntentBuilder builder = new LBIterativeSearchIntentBuilder(new Intent());
builder.setResponsibilityDialog(responsibilityDialog);
builder.setLoginCredentials(userName, password);
builder.setIntentTarget(true); // the intent will by default target the non-play-store localion navigator, with this we target play store version
Intent intent = builder.build();
// Start the intent with result
PackageManager packageManager = activity.getPackageManager();
if (packageManager != null && intent.resolveActivity(packageManager) != null) {
activity.startActivityForResult(intent, 3);
} else {
Log.d(getClass().getName(), "No Activity found to handle Intent");
Toast.makeText(getActivity(), "No Activity found to handle Intent", Toast.LENGTH_SHORT).show();
}
if (requestCode == 3) {
if (resultCode == Activity.RESULT_OK) {
String result = data.getStringExtra("result");
Log.d(getClass().getName(), "Received picked location result: " + result);
if (result.isEmpty()) {
new AlertDialog.Builder(activity).setMessage("No location picked").create().show();
} else {
new AlertDialog.Builder(activity).setMessage("Received result: " + result).create().show();
}
}
}
{
"id": 1740795785,
"address": {
"language": "de",
"components": [
{
"shortName": "Deutschland",
"types": [
"country"
]
},
{
"shortName": "Dortmund",
"types": [
"city"
]
},
{
"shortName": "Alter Hellweg",
"types": [
"street"
]
},
{
"shortName": "Marten",
"types": [
"district"
]
},
{
"shortName": "44379",
"types": [
"postalCode"
]
},
{
"shortName": "33",
"types": [
"houseNumber"
]
}
]
},
"displayCoordinate": [
7.379743,
51.500142
],
"types": [
"street_address"
]
}
intent| Constructor and Description |
|---|
LNIterativeSearchIntentBuilder(android.content.Intent intent)
A constructor for an intent builder that will adjust the given Intent
|
| Modifier and Type | Method and Description |
|---|---|
android.content.Intent |
build()
Constructs the intent with the specific parameters set
|
LNIterativeSearchIntentBuilder |
setResponsibilityDialog(boolean responsibilityDialog)
Set if the responsibility screen should be displayed, If the user did not mark the dialog to never be shown again.
|
getPackage, setIntentTarget, setLoginCredentialspublic LNIterativeSearchIntentBuilder(android.content.Intent intent)
intent - the intent to adjustpublic LNIterativeSearchIntentBuilder setResponsibilityDialog(boolean responsibilityDialog)
responsibilityDialog - True to display the screen.public android.content.Intent build()
IntentBuilderbuild in class IntentBuilder