android - Update SeekBar in Fragment with value from SharedPreferences -


I have an app with the action bar, it has a "main" piece and "preferences" piece.

  last main key = new main (); Final Preferences = New Preferences (); Drawer Ksetonmatikklelist (new Onitemkliklist () {@ Override public Whoid on Aitemklik (Adaptrwu & lt ;? & gt; args 0, ARG 1 See, Int conditions, prolonged AG 3) {piece = null; fragment manager slice Manager = See Smrthnfrejment Manager (); switch (status) {case 0: piece = main; break; case 1: section = preferences; break;} fragmentation manager. Bibititinsnpadn () Krevl (Arkaid. Frag Meant 1 piece) Kcommit (); Drovrleaut. Close dryers ();}});   

There is an explorer in the "Preferences" section that has been updated with value from the shared options. ;

  @Override public view onCreateView (LayoutInflater inflater, ViewGroup container, bundle savedInstanceState) {container.removeAllViews (): see the relevant code that makes this within the "Preferences" piece of footage = inflater .inflate (R. LayOut preferences, container, incorrect); FontSizeBar = (SeekBar) view.findViewById (R.id.fontSizeBar); SharedPreferences Preferences = PreferenceManager.getDefaultSharedPreferences (Preferences.this.getActivity (.) GetBaseContext ()); Last ant font style: = preferences.getInt ("fontSize", 10); GetActivity () RunOnUiThread (new Rnnabl) {@ Override public Boyd run () {fontSizeBar.setOnSeekBarChangeListener (new Onsekberchejh Listnr () {@Override Public void on Prgtipriwartit (SeekBar seekBar, boolean and int progress, user) {Log.v ( "Progress has changed "" font size: "+ progress);} @Override public void onStartTrackingTouch (seekbar seekbar) {Log.v (" touch "start" font size: "+ seekBar.getProgress ());} @Override public void onStopTrackingTouch (seekbar seekbar) {// TODO Automatically created method stub Log.v ("touch touching" "Size of characters:" + seekBar.getProgress ());}}); fontSizeBar.setMax (10); FontSizeBar.setProgress (font size); }}); // Layouts for this piece return inflater.inflate (R. Preferences, Container, False); }   

Progress is called the (changing) because I "progress may went", "font Logsat size: 10" Output appears to change, but not visually updated SeekBar Along with that, seekbar methods are not answered onStartTrackingTouch () and onStopTrackingTouch ()

I would appreciate any information that can shed some light about the problem.

You are doing everything fine, increasing the scenes and setting up the logic, but in the end You do this:

  return inflater.inflate (R.layout.preferences, container, incorrect);   

which will return a newly inflated layout (so leave whatever you've already done). Instead, you need to return the view , which you previously inflicted:

  return view;    

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -