Android Forums

Go Back   These FORUMS ARE DISABLED!! OUR NEW FORUMS ARE AT http://androidforum.com/ > Android Coders > Android Development, Answers, Tutorials, and Code Snippets
Connect with Facebook

Click Here To Register!
 
 
LinkBack Thread Tools Display Modes
Old 07-14-2009, 07:51 AM   #1
Junior Member
 
Join Date: Jun 2009
Posts: 7
Friends: 0
View ravikumar.tj's Profile   View ravikumar.tj's Photo Album   View ravikumar.tj's Blog   View Social Groups
Hi,

I need to display another PreferenceScreen through xml which occupies the full screen.

Calling addPrefrencesFromResource(id) with different id results in Screen Break handled by Preference Framework.


setPreferenceScreen(mPS) could be called again & it works fine but it is through code...How do I do it through XML?

Neither inflateFromResource() not PreferenceInflater is available so, I can't use setPreferenceScreen for XML?

Plz do clarify.
ravikumar.tj is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in Technorati
Old 07-23-2009, 08:44 PM   #2
Junior Member
 
Join Date: Jun 2009
Posts: 7
Friends: 0
View ravikumar.tj's Profile   View ravikumar.tj's Photo Album   View ravikumar.tj's Blog   View Social Groups
Here is a code snippet hoping that someone blessed with Android Knowledge wud answer my query...

continuePreference.xml

<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" >
<PreferenceCategory android:title="@string/softwareUpdate">
<Preference android:key="continueUpdate"
android:title="@string/continueUpdate"
android:dialogTitle="@string/continueUpdate" />
</PreferenceCategory>
</PreferenceScreen>

checkPreference.xml

<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" >
<PreferenceCategory android:title="@string/softwareUpdate">
<Preference android:key="checkUpdate"
android:title="@string/checkUpdate"
android:dialogTitle="@string/checkUpdate" />
</PreferenceCategory>
</PreferenceScreen>

Now in code, HelloAndroid.java

addPrefrencesFromResource(R.xml.checkpreference);
...
...
if(ok) //Expected Output: To replace checkPreference with continuePreference screen.
addPrefrencesFromResource(R.xml.continuepreference ); //Actual Output: Results in Screen break i.e., appending with previous screen.
...
...

Whereas if Preference Screen is loaded through code then,
setPreferenceScreen(mPS1);
...
...
if(ok) //Expected Output: To replace checkPreference with continuePreference screen.
setPreferenceScreen(mPS2); //Actual Output: Same as Expected Output


Please do let me know how do I replace the preference screen through xml.
ravikumar.tj is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in Technorati
 

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
An on screen keyboard? Capricorn beauty Android Hardware 9 02-07-2009 09:42 AM
Phone Keyboard Preference eXcaliburN Android Hardware 0 11-22-2008 12:26 AM
Screen Protector for the touch screen? fritz269 Android Chat 6 11-10-2008 05:06 PM


Unlocked G1 Phones | Buy T-Mobile G1 | Google Phone

All times are GMT -6. The time now is 04:24 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.
Copyright (c) 2012 TalkAndroid.com. All rights reserved.