Created
July 6, 2017 20:36
-
-
Save nikhilbansal97/9d1bbbc36144d2b7f43a8cf28ff8fd04 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private String createUrl() { | |
UId = mUser.getKey(); | |
if (UId.isEmpty()) { | |
Snackbar.make(findViewById(R.id.main_activity_layout), | |
"You need to save your data to the cloud first!", | |
Snackbar.LENGTH_INDEFINITE) | |
.setAction("Add", new View.OnClickListener() { | |
@Override | |
public void onClick(View v) { | |
startActivity(new Intent(MainActivity.this, UserDataActivity.class)); | |
} | |
}); | |
return null; | |
} | |
StringBuilder qBuilder = new StringBuilder(); | |
for (int i = 0; i < contactShareList.size(); i++) { | |
String x = contactShareList.get(i); | |
qBuilder.append(x); | |
if (i != contactShareList.size() - 1) { | |
qBuilder.append("."); | |
} | |
} | |
String qString = qBuilder.toString(); | |
String queryString = null; | |
queryString = Base64.encodeToString(qString.getBytes(), Base64.DEFAULT).trim(); | |
Log.d(TAG, "createUrl: " + queryString); | |
Uri uri = new Uri.Builder() | |
.scheme("https") | |
.authority(AUTHORITY) | |
.appendPath("api") | |
.appendPath("users") | |
.appendPath(UId) | |
.appendPath(queryString).build(); | |
contactShareList.clear(); | |
Log.d(TAG, "createUrl: " + uri.toString()); | |
return uri.toString(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment