1 package com.xtremelabs.robolectric.shadows;
2 
3 import android.preference.PreferenceActivity;
4 import android.preference.PreferenceScreen;
5 import android.widget.ListView;
6 
7 import com.xtremelabs.robolectric.internal.Implementation;
8 import com.xtremelabs.robolectric.internal.Implements;
9 
10 @Implements(PreferenceActivity.class)
11 public class ShadowPreferenceActivity extends ShadowListActivity {
12 
13 	private int preferencesResId = -1;
14 	private PreferenceScreen preferenceScreen;
15 
16 	@Implementation
addPreferencesFromResource(int preferencesResId)17 	public void addPreferencesFromResource(int preferencesResId) {
18 		this.preferencesResId = preferencesResId;
19 		preferenceScreen = getResourceLoader().inflatePreferences(getApplicationContext(), preferencesResId);
20 	}
21 
getPreferencesResId()22 	public int getPreferencesResId() {
23 		return preferencesResId;
24 	}
25 
26 	@Implementation
getPreferenceScreen()27 	public PreferenceScreen getPreferenceScreen() {
28 		return preferenceScreen;
29 	}
30 }
31