Coder Social home page Coder Social logo

Comments (5)

GoogleCodeExporter avatar GoogleCodeExporter commented on September 2, 2024
Hi @rojas...,

For example here is an XML file for a PreferenceActivity (pre Honeycomb), we 
name it `res/xml/your_preferences.xml`:

    <?xml version="1.0" encoding="utf-8"?>
    <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
        android:title="Settings" >

        <Preference
            android:key="pkey_lock_pattern_change_pattern"
            android:title="Change pattern" />
    </PreferenceScreen>

In your PreferenceActivity, you load it with:

    import android.preference.Preference;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        addPreferencesFromResource(R.xml.your_preferences);

        findPreference("pkey_lock_pattern_change_pattern")
                .setOnPreferenceClickListener(
                        new Preference.OnPreferenceClickListener() {

                            @Override
                            public boolean onPreferenceClick(
                                    Preference preference) {
                                // Start LockPatternActivity here...
                                return true;
                            }// onPreferenceClick()
                        });
    }// onCreate()

I hardcoded some strings, you might want to put them into 
`res/values/strings.xml`. With Honeycomb+, you do the same in your 
`PreferenceFragment`'s.

Hope this helps  :-)

Have a nice day,
Hai

Original comment by [email protected] on 10 May 2013 at 5:58

  • Added labels: Component-Logic, Type-Other, Priority-Low

from android-lockpattern.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 2, 2024

Original comment by [email protected] on 10 May 2013 at 3:29

  • Changed state: Done

from android-lockpattern.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 2, 2024
Thanks, that was easy!

Excellent library by the way!

Original comment by [email protected] on 11 May 2013 at 4:10

from android-lockpattern.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 2, 2024
I've added some changes to the 
[https://code.google.com/p/android-lockpattern/source/browse/demo demo project] 
which make use of `PreferenceActivity` and `PreferenceFragment`'s. Though it's 
a little complicated  :-D

You might want to download the demo APK in 
[https://code.google.com/p/android-lockpattern/downloads/list Downloads] 
section or on 
[https://play.google.com/store/apps/details?id=group.pals.android.lib.ui.lockpat
tern.demo Google Play]  :-)

Original comment by [email protected] on 21 May 2013 at 1:48

from android-lockpattern.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 2, 2024
Thanks, I'll check it out. Nice job!

Original comment by [email protected] on 22 May 2013 at 2:12

from android-lockpattern.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.