Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android Android Data Persistence Key-Value Saving with SharedPreferences Creating a Settings Page

content-assist issue on Mac

I am facing with different options when i do content assist with alt+enter. For example, the options are like these:

-Override resource in other configuration -Edit AIDL Fragment -Language injection settings -Un-inject language reference

I couldn't see like "create string value resource storage_key"

<ListPerefence android:key="@string/storage_key" android:title="@string/title_storage_type" android:dialogTitle="@string/title_storage_type" android:entries="@array/storageEntries" android:entryValues="@array/storageValueEntries" android:defaultValue="@string/storage_default_value" />

I need to create resources for string values.

If anyone can help me to solve or understand the issue i greatly appreciate. I can't move further without handling this problem. Thanks!

zahir herz
zahir herz
3,513 Points

1 - Make sure you type your initial string value ie android:key="@string/storage_key"

2 - Click inside the string text before pressing alt - return.

Hello Zahir,

Actually I did exactly the same thing but my problem is still continuing. Do you have another idea or a possibility that causes this problem? Thank you for your help!

2 Answers

zahir herz
zahir herz
3,513 Points

-Shut down / Restart your computer -Create a new project in Android Studio -Try retesting with Alt-Return.

Some additional shortcuts for you: http://www.developerphil.com/android-studio-tips-of-the-day-roundup-2/

I created a new project and tried to test alt+return, which is perfectly okay. My problem is that i don't see any error sign when i type like

android:key="@string/storage_key"

i feel like storage_key is initialized in somewhere that's why compiler doesn't underline storage_key. So the problem is still continuing and i don't have any clue.. I am getting errors only when I run the app.