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; //from w ww .jav a 2s . c om import headrevision.BehatReporter.R; import headrevision.BehatReporter.store.ReportUrl; import android.app.Activity; import android.view.Menu; import android.view.MenuInflater; public class OptionsMenu { private static OptionsMenu instance; private Activity activity; private OptionsMenu(Activity activity) { this.activity = activity; } public static OptionsMenu getInstance(Activity activity) { if (instance == null || instance.activity != activity) { instance = new OptionsMenu(activity); } return instance; } public void create(Menu menu) { MenuInflater menuInflater = activity.getMenuInflater(); menuInflater.inflate(R.menu.main, menu); } public void show(Menu menu) { menu.findItem(R.id.menu_url).setVisible(true); String reportUrl = ReportUrl.getInstance(activity).retrieve(); menu.findItem(R.id.menu_refresh).setVisible(!reportUrl.equals("")); } public void hide(Menu menu) { menu.findItem(R.id.menu_url).setVisible(false); menu.findItem(R.id.menu_refresh).setVisible(false); } }