这是需要实现的效果,在第二个Activity读取category的属性,但是我得到的结果是category为null,请问如何能正确得到category的属性?
AndroidManifest.xml:
<activity android:name=".Second">
<intent-filter>
<action android:name="com.PiscesYE.ACTION"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
secondActivity.java:
show1=findViewById(R.id.show1);
show2=findViewById(R.id.show2);
String activityShow=getIntent().getAction();
show1.setText("Action为:"+activityShow);
show2.setText("Category的属性为:"+getIntent().getCategories());
结果为:
老哥,你这是华软的ppt吧?这个要现在manifest中对action和category进行设置