Sea*_*lly 19 android android-emulator
我在Eclipse(Mac OS X)中有一个简单的应用程序HelloWorld Android应用程序,当我安装到模拟器/ AVD时,应用程序显示在"设置 - > [设备]应用程序"中,但不在启动器中.我在logcat中注意到我得到了这些错误
W/ActivityManager( 160): No content provider found for permission revoke: file:///data/local/tmp/HelloWorld.apk
W/ActivityManager( 160): No content provider found for permission revoke: file:///data/local/tmp/HelloWorld.apk
I/PackageManager( 160): Running dexopt on: com.example.helloworld
D/dalvikvm( 870): DexOpt: load 124ms, verify+opt 459ms, 720236 bytes
I/ActivityManager( 160): Force stopping package com.example.helloworld uid=10044
Run Code Online (Sandbox Code Playgroud)
我在.android目录上设置了读/写/执行权限.
在我的情况下,我忘了定义主要活动.所以,我在AndroidManifest.xml 主要活动中添加以下代码.
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
Run Code Online (Sandbox Code Playgroud)
这是活动定义的结果:
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity android:name="RssfeedActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity android:name="DetailActivity"></activity>
</application>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
42853 次 |
| 最近记录: |