7月 162012

1. App crashes when it starts, because I make a error to set TextView.textcolor to a String resource Value, it should be a drawable resource value

2. I wrote a function which used Context of the activity. But when I finished coding, eclipse gave an error message. After a about 1 hour research, I finally found I wrote the function in the subclass of the activity. After moving the function to the main class, it works.

3. (be continued…)

 Posted by on 2012-07-16
7月 162012

When I gave a margin value 10 to TextView, the eclipse give a below error message.

error: Error: Integer types not allowed (at ‘layout_margin’ with value ’10’).

I searched on internet, and found can’t give a integer value to it, should use 10dip.

 Posted by on 2012-07-16

StrictMode of android

 分类:Android 阅读 (1,655)  No Responses »
7月 122012

StrictMode is a developer tool which used to detect accident in program. For example, if you do internet access or local file operation in the UI directly, the strictmode mechanism will throw an error to the application.

StrictMode is used default since Android 3.0(HoneyComb).

example of a wrong case

If you request an url like above, your app will crashes.

So the right thing we do this is we can run the internet request in thread(Threads, AsyncTask, Handler), I give a simple by AsyncTask.

It looks very troublesome when we just debug the program, so we can also use a simple code to disable ThreadPolicy to avoid errors.

7月 112012

WordPress Ver: 3.4.1
Theme: suffusion version 4.2.5

A screen shot of where is the category navbar

Steps to configure the option

1. Sign in your wordpress back-end
2. Select page Appearance->Suffusion Options on the left function navigation bar
3. Select “Other Graphical Elements” on the top of suffusion options page

4. Select “Breadcrumbs and Page Navigation” on the left bar

5. And now you can configure the category text navigation bar in the page now.

7月 102012