这是我的活动代码:
package com.microweb.gapiha;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.Bundle;
import android.app.TabActivity;
import android.content.Context;
import android.content.Intent;
import android.view.WindowManager;
import android.widget.TabHost;
@SuppressWarnings("deprecation")
public class MainActivity extends TabActivity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//setContentView(R.layout.activity_main);
//keep screen on and alive
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
TabHost mTabHost = getTabHost();
mTabHost.addTab(mTabHost.newTabSpec("first").setIndicator("social").setContent(new Intent(this ,IntroActivity.class )));
mTabHost.addTab(mTabHost.newTabSpec("second").setIndicator("chat").setContent(new Intent(this ,ChatActivity.class )));
mTabHost.addTab(mTabHost.newTabSpec("sevom").setIndicator("new chat").setContent(new Intent(this ,RandomActivity.class )));
mTabHost.setCurrentTab(0);
}
@SuppressWarnings("unused")
private boolean isNetworkAvailable() {
ConnectivityManager connectivityManager = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo activeNetworkInfo = connectivityManager.getActiveNetworkInfo();
return activeNetworkInfo != null && activeNetworkInfo.isConnected();
}
}
这是日志:
http://s4.picofile.com/file/7855602903/err.png
当我在模拟器或我的设备中运行项目时,它显示了力量 关闭错误......为什么?在我运行这个项目之前没有任何错误但是 现在,......我不做任何改变......
这是xml代码:
<WebView
android:id="@+id/wv1"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<ProgressBar
android:id="@+id/pB1"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:padding="2dip" />