开发者

Unable to add Preferences.xml (Android Preferences in XML)

开发者 https://www.devze.com 2023-01-24 05:44 出处:网络
Hopefully, this is a newbie question with a quick answer... I am attempting to add a simple preferences file in a new Android project (New -> Android XML File), but it doesn\'t appear to be working c

Hopefully, this is a newbie question with a quick answer...

I am attempting to add a simple preferences file in a new Android project (New -> Android XML File), but it doesn't appear to be working correctly.

There is no root element to choose from when I select the Preference type layout. If I press Finish, it doesn't do开发者_如何学Python anything. See screenshot below.

Thanks, wTs

Unable to add Preferences.xml (Android Preferences in XML)


Just create a normal xml file to the project /res/xml/ folder and add your content to the file as usual. Should work just great. Eclipse detects it as a preference file once you have added the preference-xml and saved it.


You don't need to have a root element in the selection screen. Just replace whatever eclipse generates with what you want.


try refreshing the folder that the file is supposed to be in (in your example res/xml).

0

精彩评论

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