Android例子HelloTabWidget 运行报错 解决办法

最近android很火,老能看到新闻,咱也得与时俱进一下,按照官方文档学习了下,发现运行HelloTabWidget这个例子时报错,Google了一下,发现这个问题历史挺悠久的,目前按照
[url]http://developer.android.com/resources/tutorials/views/hello-tabwidget.html[/url]来做,需要做如下即可运行正常:
1、在res.draw下面添加:
ic_tab_artists.xml
ic_tab_artists_grey.png
ic_tab_artists_white.png
ic_tab_songs.xml
ic_tab_songs_white.png
ic_tab_songs_grey.png

xml内容参照ic_tab_artists.xml

2、修改AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.helloandroid"
android:versionCode="1"
android:versionName="1.0">

<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".HelloTabWidget"
android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<activity android:name=".AlbumsActivity" android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar">
</activity>

<activity android:name=".ArtistsActivity" android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar">
</activity>

<activity android:name=".SongsActivity" android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar">
</activity>

</application>
</manifest>

这个文档做了说明,但很含糊
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值