Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/336.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 我正在尝试使用tabhost及其创建问题_Java_Android_Android Tabhost - Fatal编程技术网

Java 我正在尝试使用tabhost及其创建问题

Java 我正在尝试使用tabhost及其创建问题,java,android,android-tabhost,Java,Android,Android Tabhost,我正在尝试使用tabhost,它显示以下错误: 调用landroid/util/sparsearray时线程id=1 StackOverflow;二进制搜索 为什么会这样 这是我的密码: setContentView(R.layout.menu); TabHost mytabhost; mytabhost=getTabHost(); TabSpec homespec=mytabhost.newTabSpec("home"); homespec.setIndicator("Home",getRes

我正在尝试使用tabhost,它显示以下错误:

调用landroid/util/sparsearray时线程id=1 StackOverflow;二进制搜索

为什么会这样

这是我的密码:

setContentView(R.layout.menu);
TabHost mytabhost;
mytabhost=getTabHost();
TabSpec homespec=mytabhost.newTabSpec("home");
homespec.setIndicator("Home",getResources().getDrawable(R.drawable.home));
Intent homeintent=new Intent(getApplicationContext(),menu.class);
homespec.setContent(homeintent);

TabSpec infospec=mytabhost.newTabSpec("info");
infospec.setIndicator("Info",getResources().getDrawable(R.drawable.info));
Intent infointent=new Intent(getApplicationContext(),info.class);
infospec.setContent(infointent);

TabSpec servicespec=mytabhost.newTabSpec("Services");
servicespec.setIndicator("Services",getResources().getDrawable(R.drawable.services));
Intent serviceintent=new Intent(getApplicationContext(),services.class);
servicespec.setContent(serviceintent);

TabSpec onlinespec=mytabhost.newTabSpec("onlinetools");
onlinespec.setIndicator("Onlinetools",getResources().getDrawable(R.drawable.onlinetools));
Intent onlineintent=new Intent(getApplicationContext(),onlinetools.class);
onlinespec.setContent(onlineintent);

TabSpec mediaspec=mytabhost.newTabSpec("MediaCenter");
mediaspec.setIndicator("MediaCenter",getResources().getDrawable(R.drawable.mediacenter));
Intent mediaintent=new Intent(getApplicationContext(),mediacenter.class);
mediaspec.setContent(mediaintent);

mytabhost.addTab(homespec);
mytabhost.addTab(infospec);
mytabhost.addTab(servicespec);
mytabhost.addTab(onlinespec);
mytabhost.addTab(mediaspec);

您可以发布完整的stacktrace吗?threadid=1:调用Landroid/util/SparseArray;时堆栈溢出;。binarySearch:ILIII方法需要36+20+0=56字节,fp为0x4403e32c(左44)扩展堆栈端(0x4403e300到0x4403e000)。此线程是否有帮助: