Back to project page MiniExpense.
The source code is released under:
Apache License
If you think the Android project MiniExpense 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 com.duplavid.miniexpense; /*from w ww . j a v a 2s . co m*/ import android.content.Context; import android.content.SharedPreferences; import android.preference.PreferenceManager; import android.view.Menu; import android.view.MenuItem; public class MenuMethods{ public static void euroBlue(Context context, Menu menu){ SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(context); SharedPreferences.Editor editor = settings.edit(); editor.putString("currency", "euro"); editor.commit(); MenuItem item = menu.findItem(R.id.euro); item.setIcon(R.drawable.euroblue); MenuItem item2 = menu.findItem(R.id.dollar); item2.setIcon(R.drawable.dollar); } public static void dollarBlue(Context context, Menu menu){ SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(context); SharedPreferences.Editor editor = settings.edit(); editor.putString("currency", "dollar"); editor.commit(); MenuItem item = menu.findItem(R.id.dollar); item.setIcon(R.drawable.dollarblue); MenuItem item2 = menu.findItem(R.id.euro); item2.setIcon(R.drawable.euro); } }