Back to project page BehatReporter.
The source code is released under:
Copyright (C) 2013 Fabian Kiss <headrevision@gmail.com> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software...
If you think the Android project BehatReporter listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package headrevision.BehatReporter.ui; //w ww . j ava2 s . co m import android.app.Activity; import android.widget.Toast; public class Message { private static Message instance; private Activity activity; private Message(Activity activity) { this.activity = activity; } public static Message getInstance(Activity activity) { if (instance == null || instance.activity != activity) { instance = new Message(activity); } return instance; } public void showInfo(int resourceId) { String message = activity.getResources().getString(resourceId); show(message, Toast.LENGTH_SHORT); } public void showError(Exception exception) { String message = "ERROR: " + exception.getMessage(); show(message, Toast.LENGTH_LONG); } private void show(String message, int duration) { Toast toast = Toast.makeText(activity, message, duration); toast.show(); } }