开发者

Activites not startable because of package?

I tried to put a preference activity in sub package. The main packages name is my.app.lication.android.credentials and the main package is my.app.lication.android

When I put the preference activity in the sub package and configure the manifest like so:

<activity 
  android:name="MyCredentials"
  android:label="@string/app_name">
  <intent-filter>         
      <action android:name="my.app.lication.android.credentials.MyCredentials" />
      <category android:name="my.app.lication.android.credentials.MyCredentials" />
  </intent-filter>
</activity>

the start fails and I get a ActivityNotFoundException. If I put the MyCredentials class in the main package and configure the manifest like so:

<activity 
  android:name="MyCredentials"
  android:label="@string/app_name">
  <intent-filter>         
      <action android:name="my.app.lication.android.MyCredentials" />
      <category android:name="my.app.lication.android.MyCredentials" />
  </intent-filter>
</activity>

it works. C开发者_高级运维an somebody explain why the SDK behaves this way?


Try android:name=".credentials.MyCredentials" in your first manifest example.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜