Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7068605
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:20:39+00:00 2026-05-28T05:20:39+00:00

If you have time , please can you take some time for me ?

  • 0

If you have time , please can you take some time for me ? I really need some help.

Let me explain;
Im working on an android app.

There is a layout and it has 5 ImageButton and a webview. When the users click on a imagebutton, without problem it calls a website below..but more or less i have 20 web site.i want to add an option for users..for example the user will choose a web site from Prefs. screen then automatically one of imagebuttons values (i mean icon AND its loadurl function) will change.

I created Pref Screen and i can see my website in this which i wrote in array.xml

but totally im not able to set them to Imagebuttons..

im beggin u.its our last curve..then it ll finish.

Im tried to use this code :

Data = getSharedPreferences(filename, 0);
SharedPreferences.Editor e = data.edit();
        e.putString("website", websiteVariable);
        e.commit();

but i couldnt.
Please explain me step by step clearly.
also i dont want that only for me,on internet there is no source for this issue.im searching and trying everything what i can think more than 6 days but nothing.
Thank you so much

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T05:20:40+00:00Added an answer on May 28, 2026 at 5:20 am
       SharedPreference   Data = getSharedPreferences(filename, 0);
       SharedPreferences.Editor e = data.edit();
        e.putString("website", websiteVariable);
        e.commit();
    

    Basically what this does is allows you to store user information such as scores for a game, stats, and other variables.

    The first line gets reference or creates the file to write the data to.

    The second line allows you to edit the file to write new information to it..

    e.putString() 
    

    Takes two parameters the first one being the Key to pull the value you out later, and the second being the value you want to put into the file.

    The last line commits the data so that it is saved to the file.

    You can get more info from the docs here

    Also if you want to pull the data out just do

    SharedPreference   Data = getSharedPreferences(filename, 0);
    String value = Data.getString("website"); // use the key here to pull the data out
    

    EDIT:

    So for example if the user selects a certain image you could use a key to refer to each image and get the value later to decided which icon the user picked before.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Looking for some help and advice please from Super Guru MySQL/PHP pros who can
I have an app that requires me to take an action after some period
I'm working on Android UI Thread, and there is one time-consuming work, so I
I have a calculation task that will take some time to complete. Minutes. Maybe
First time Stack Overflow poster. Please bear with me! :) I have a set
I need to learn RegEx but don't have time to figure this out right
I'm working on an application in C# with .Net 3.5. I have time zone
I was working on some grouping problems at my work. There are quite a
I have been working with .Net since VS2002 and since then any time that
I have been looking for quite some time for an answer to this, and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.