ITeye博客

android

共 2 篇文章

TabHost 切换带滑动及tab页的数据添加

一、在layout下创建TabHost的home.xml <?xml version="1.0" encoding="utf-8"?> <TabHost xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/tabhost" android:layout_width="fill_parent" android:layout_height="fill_parent" > <LinearLayout android:layout_width="fill_parent" android:layout_…

2014-05-22 10:05 · android

android2.3与android4.0访问网络的异同

//解决Android4.0不能在主线程中进行HTTP请求 //在Android4.0以后,会发现,只要是写在主线程(就是Activity)中的HTTP请求,运行时都会报错,这是因为Android在4.0以后为了防止应用的ANR(aplication Not Response)异常. //就针对此问题有两种解决的方法: //1.可以再Activity的onCreate()方法中加入这样一段代码,如下: if (Build.VERSION.SDK_INT >= 11) { StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builde…

2014-05-07 11:11 · android