-
Recent Posts
Recent Comments
- vidya on Toolbar overlapping listView
- wpadmin on SAX parser using AsyncTask to read xml file on net
- Free Stuff on SAX parser using AsyncTask to read xml file on net
- Crave Freebies on SAX parser using AsyncTask to read xml file on net
- wpadmin on Resources references from the manifest cannot vary by configuration
Archives
- September 2018
- July 2018
- June 2018
- October 2017
- July 2017
- June 2017
- May 2017
- April 2017
- March 2017
- December 2016
- June 2016
- March 2016
- February 2016
- November 2015
- May 2015
- January 2015
- April 2014
- March 2014
- January 2014
- December 2013
- November 2013
- October 2013
- September 2013
- August 2013
- July 2013
- June 2013
- May 2013
Categories
Meta
Monthly Archives: November 2013
Textwatcher example
A simple example to watch or text changed. ((EditText)view.findViewById(R.id.manualCodeEntry)).addTextChangedListener(new TextWatcher() { @Override public void afterTextChanged(Editable arg0) { // TODO Auto-generated method stub } @Override public void beforeTextChanged(CharSequence arg0, int arg1, int arg2, int arg3) { // TODO Auto-generated method stub … Continue reading
Posted in Android
Leave a comment
Simple listview example
1. Start with a simple layout for each line. <?xml version=”1.0″ encoding=”utf-8″?> <TextView xmlns:android=”http://schemas.android.com/apk/res/android” android:layout_width=”fill_parent” android:layout_height=”fill_parent” android:padding=”10dp” android:textSize=”20sp” > </TextView> Create activity extending ListActivity. public class WordListActivity extends ListActivity { static final String[] words = new String[] { “Apple”, “Bread”, … Continue reading
Posted in Android
Leave a comment
Eclipse oddities
1. Unbound prefix I was getting an error in a layout file: error parsing xml, unbound prefix. It turned out that a line of xml pasted in from another (working) layout file contained the prefix ‘android1:’, whereas all other lines … Continue reading
Posted in Android
Leave a comment
Examples of setting colours dynamically
Buttons and textviews. button.setBackgroundColor(Color.parseColor(“#bdbdbd”)); yourTextView.setTextColor(0xffbdbdbd); textView.setTextColor(getResources().getColor(R.color.sf_yellow)); Where colors.xml (in values folder) contains <resources> <color name=”sf_yellow”>#f5e214</color> </resources> On canvas simply: canvas.drawColor(Color.BLUE); or for greater control: float[] color=new float[3]; // HSV (0..360,0..1,0..1) //color[0]=(float)(Math.random()*360); color[0]=197; color[1]=1; color[2]=1; canvas.drawColor(Color.HSVToColor(color));
Posted in Android
Leave a comment