Is there an easy way to add a border to the top and bottom of an Android View?

I have a TextView and I’d like to add a black border along its top and bottom borders. I tried adding android:drawableTop and android:drawableBottom to the TextView, but that only caused the entire view to become black. <TextView android:background=”@android:color/green” android:layout_width=”fill_parent” android:layout_height=”wrap_content” android:drawableTop=”@android:color/black” android:drawableBottom=”@android:color/black” android:text=”la la la” /> Is there a way to easily add a … Read more

Android basics: running code in the UI thread

In the viewpoint of running code in the UI thread, is there any difference between: MainActivity.this.runOnUiThread(new Runnable() { public void run() { Log.d(“UI thread”, “I am the UI thread”); } }); or MainActivity.this.myView.post(new Runnable() { public void run() { Log.d(“UI thread”, “I am the UI thread”); } }); and private class BackgroundTask extends AsyncTask<String, Void, … Read more