Skip to content

Instantly share code, notes, and snippets.

private TextView tvVersion;
tvVersion = (TextView) root.findViewById(R.id.about_txt_version);
tvVersion.setText(VERSION + getApplicationVersion(getActivity().getApplicationContext()));
public static String getApplicationVersion(Context context) {
String appVersion = "";
try {
@steviecoyle
steviecoyle / Custom Exception
Last active January 6, 2017 20:33
How-to create a custom exception in Java
public class TestClass {
try {
throw new InvalidApplicationException("Some Text");
} catch (InvalidApplicationException e) {
e.printStackTrace();
}
// Exception Creation
public class InvalidApplicationException extends Exception {
public InvalidApplicationException(String message) {