Android: Verify the string content before indexing
This commit is contained in:
parent
4b24d22385
commit
f255553ce8
|
@ -59,8 +59,10 @@ public class AboutFragment extends Fragment {
|
|||
TextView version = (TextView) getView().findViewById(R.id.revision_text);
|
||||
version.setText(getString(R.string.revision_text,
|
||||
versionName, String.valueOf(versionCode)));
|
||||
if (versionName.contains("-")) {
|
||||
int start = versionName.lastIndexOf("-");
|
||||
buildId = versionName.substring(start + 2, start + 9);
|
||||
}
|
||||
} catch (NameNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue