" Live as if you were to die tomorrow. Learn as if you were to live forever.. "
- Mahatma Gandhi

Accessing resources like color from non activity classes

Posted on November 23rd, 2015 by Ashish Sharma

Setting the rerources like color using resource file does not work in non activity class. We need to access the resource folder and then we can set the color. Eg: TextView tv = (TextView)findViewById(R.id.text1); Incorrect: tv.setTextColor(R.color.color_name); Correct Syntex: tv.setTextColor(getResources().getColor(R.colo.color_name));  

Simple Implementation To Customize action_mode_close Button From ActionMode Layout

Posted on November 23rd, 2015 by Ravi Kumar

We will address the above though the following example. Note : We will be modifying the predefined layout for action_mode_close_button .Main Task : Removing Done text from ActionModeClose button layout. Resolution 1 :  One way to hide it is to access the resource id of the view that we want to customize using Resources api […]