Skip to content

Instantly share code, notes, and snippets.

@gguuss
Created November 16, 2017 01:28
Show Gist options
  • Save gguuss/d755536e7f054e70febbe7a518c7a945 to your computer and use it in GitHub Desktop.
Save gguuss/d755536e7f054e70febbe7a518c7a945 to your computer and use it in GitHub Desktop.
if (mResponse != null) {
// Manually filter the proto message to the label descriptions
ArrayList<String> labels = new ArrayList<String>();
String labelstr = "";
if (mResponse != "No stored label data") {
for (String it : mResponse.split(",")) {
if (it.split(":")[0].contains("description")) {
labels.add(it.split(":")[1]);
labelstr += it.split(":")[1] + " / ";
}
}
Log.d(TAG, "Found: " + labels.size() + " labels.");
} else {
Log.d(TAG, "Building cache...");
}
((TextView) findViewById(R.id.response_data))
.setText(labelstr);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment