hi all:
i found a surprised problem descripted following
manifest.xml
<application android:icon="@drawable/icon"
android:label="@string/app_name">
<activity android:name=".IntentMainActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".CategoryAltertiveActivity"
android:label="CategoryAltertive">
<intent-filter android:label="alternative">
<action android:name="edu.lib.altertive" />
<category android:name="android.intent.category.ALTERNATIVE"
/>
</intent-filter>
</activity>
</application>
java code :
Intent intent=new Intent();
intent.setAction("edu.lib.altertive");
intent.addCategory(Intent.CATEGORY_ALTERNATIVE);
startActivity(intent);
i got an ActivityNotFoundException,but i have already registered
CategoryAltertiveActivity in manifest.xml ,and by
Intent intent =new Intent(this,CategoryAltertiveActivity.class)
startActivity(intent)
it run normally,and use getPackageManager.queryIntentActivity(intent),return
result which included ActivityInfo of CategoryAltertiveActivity.
why?
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en