Exception description:java
__________________________________________________________________________________android
05-29 15:47:17.936: E/AndroidRuntime(10458): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.smalant.demo.actionbar.test/com.smalant.demo.actionbar.test.MainActivity}: java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.VIEW cmp=com.smalant.demo.actionbar/.OtherActivity } from ProcessRecord{418dd770 10458:com.smalant.demo.actionbar.test/10128} (pid=10458, uid=10128) not exported from uid 10127app
______________________________________________________________________________________ui
解決辦法:this
U have to add android:exported="true"
in the manifest file in the activity you are trying to startspa
From the link given abovecode
android:exported
Whether or not the activity can be launched by components of other applications — "true" if it can be, and "false" if not. If "false", the activity can be launched only by components of the same application or applications with the same user ID.componentThe default value depends on whether the activity contains intent filters. The absence of any filters means that the activity can be invoked only by specifying its exact class name. This implies that the activity is intended only for application-internal use (since others would not know the class name). So in this case, the default value is "false". On the other hand, the presence of at least one filter implies that the activity is intended for external use, so the default value is "true".ip
This attribute is not the only way to limit an activity's exposure to other applications. You can also use a permission to limit the external entities that can invoke the activity (see the permission attribute).ci