2013-08-22 145 views
0

我创建了工作的动态壁纸。然后,我尝试在config中添加主要活动,但当点击程序列表上的图标时,出现“Launcher无权启动Intent”错误。Android - 动态壁纸+活动“启动器没有启动意图的权限”

ERROR/Launcher(8246): Launcher does not have the permission to launch Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.revicostudio.neonshiftwallpaper/.ConfigActivity }. Make sure to create a MAIN intent-filter for the corresponding activity or use the exported attribute for this activity. tag=ApplicationInfo(title=Neon Shift Wallpaper) intent=Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.revicostudio.neonshiftwallpaper/.ConfigActivity } 
java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.revicostudio.neonshiftwallpaper/.ConfigActivity } from ProcessRecord{41ea3da8 8246:com.android.launcher/u0a10035} (pid=8246, uid=10035) not exported from uid 10139 

清单:

<?xml version="1.0" encoding="utf-8"?> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
      package="com.revicostudio.neonshiftwallpaper" 
      android:versionCode="1" 
      android:versionName="1.0"> 
    <uses-sdk android:minSdkVersion="9" android:targetSdkVersion="17"/> 

    <uses-feature 
      android:glEsVersion="0x00020000" 
      android:required="true" 
      android:name="android.software.live_wallpaper"> 
    </uses-feature> 

    <application 
      android:icon="@drawable/icon" 
      android:configChanges="keyboardHidden|orientation" 
      android:label="@string/app_name" > 
     <!-- Live Wallpaper Service --> 
     <service android:name=".MainService" 
       android:enabled="true" 
       android:configChanges="keyboardHidden|orientation" 
       android:permission="android.permission.BIND_WALLPAPER" 
       android:icon="@drawable/icon" 
       android:description="@string/wallpaper_description"> 
      <intent-filter> 
       <action android:name="android.service.wallpaper.WallpaperService"/> 
      </intent-filter> 
      <meta-data android:name="android.service.wallpaper" 
         android:resource="@xml/wallpaper"/> 
     </service> 

     <activity 
       android:name=".ConfigActivity" 
       android:label="@string/app_name" 
       android:exported="true" 
       android:theme="@android:style/Theme.Light.WallpaperSettings" > 
      <intent-filter> 
       <action android:name="android.intent.action.MAIN" /> 

       <category android:name="android.intent.category.LAUNCHER" /> 
      </intent-filter> 
     </activity> 

     <activity 
       android:name="com.revicostudio.neonshiftwallpaper.WallpaperPreferences" 
       android:exported="true" 
       android:label="@string/app_name" 
       android:theme="@android:style/Theme.Light.WallpaperSettings" > 
     </activity> 
    </application> 
</manifest> 

回答

1

我想这是因为当你添加一个快捷方式到一个应用程序在主屏幕上,发射器保持它的原意自己的副本从您的清单,也许格式化作为一个String而不是一个实际的Java对象。

因此,通过修改过滤器或其指向的类来更改意图后,最终会出现死锁的快捷方式。

如果这是发生在你身上的事,如果你尝试从应用程序抽屉中启动它,它应该可以正常工作。您可以从主屏幕上删除快捷方式并重新添加,并且新的快捷方式应该可以工作。

如果您在两次发布之间修改主要活动的类名,则会发生这种情况。