Start Activity from preference screen (intent defined in xml file)

前端 未结 6 2313
我在风中等你
我在风中等你 2021-01-01 18:18

In my preference file I go this

    
        
    

        
6条回答
  •  执念已碎
    2021-01-01 19:20

    This isn't the right way to start an intent from xml. The android:action field isn't for the name of the activity you are trying to start; it describes an action for an intent-filter (such as android.intent.action.VIEW or android.intent.action.EDIT) that another activity can supply.

    See this answer for the correct use of >, android:action, etc: https://stackoverflow.com/a/3751306/582004

    Make sure that in your AndroidManifest.xml, your activity contains an > with the > that you are requesting in your PreferenceActivity (in the answer referenced, this is android.intent.action.VIEW).

提交回复
热议问题