Settings - Shared Aplicattion Facebook.

Discussion in 'Archive - LWC 2.1' started by Vinicius, Apr 24, 2013.

  1. Vinicius In the know

    Member Since:
    Apr 16, 2013
    Message Count:
    25
    Likes Received:
    7
    Trophy Points:
    25
    Hi guys I'm back = D

    Staff would like to put a button in the shared settings so that users can share my app's on facebook.

    Does anyone have any tutorial that teaches you to do this, or how I could do this so quickly and easily?

    Thank you guys!
  2. Vinicius In the know

    Member Since:
    Apr 16, 2013
    Message Count:
    25
    Likes Received:
    7
    Trophy Points:
    25
    Hi Guys!

    I managed to do!

    I got the following:


    In LiveWallpaperSettings.java:

    Added after this line:

    PreferenceCategory main_preference_category = (PreferenceCategory) findPreference ("main_preference_category");

    The Following Code:
    / / In u = you put the url of your app on google play!



    getPreferenceManager().findPreference("facebook")
    .setOnPreferenceClickListener(
    new OnPreferenceClickListener() {
    @Override
    public boolean onPreferenceClick(
    Preference preference) {
    Intent intent = new Intent(Intent.ACTION_VIEW);
    intent.setData(Uri
    .parse("http://www.facebook.com/sharer.php?...=W251bGwsMSwxLDEsImNvbS5hbmRyb2lkLmNocm9tZSJd"));
    startActivity(intent);
    return true;
    }
    });

    After the file lwp_settings I put the following code inside the <PreferenceCategory>

    <Preference
    android: title = "Shared facebook"
    android: summary = "Shared Facebook! Thank you!"
    android: key = "facebook" />

    Ready = D
    Maximus and James Rebello like this.

Share This Page