Android: Why?®SeekBar

Source: Internet
Author: User

Android: Why? ~öseekbar
Android: Why? ~öseekbar* Öð Ê Ó óó ± Ï à µ± μ? Â ¡

MainActivity. java £°
Package com. example. seekbar;


Import android. OS. Bundle;
Import android. app. Activity;
Import android. view. Menu;
Import android. widget. SeekBar;


Public class MainActivity extends Activity {


Private SeekBar mySeekBar = null;
@ Override
Protected void onCreate (Bundle savedInstanceState ){
Super. onCreate (savedInstanceState );
SetContentView (R. layout. main );

MySeekBar = (SeekBar) findViewById (R. id. mySeekBar );
// The value of É ööã SeekBar µää ø {è × î ''.
MySeekBar. setMax (100 );

// ° Ónāseekbar maid?
MySeekBar. setOnSeekBarChangeListener (new setSeekBarListener ());
}

// ''Salesman' SeekBar µää â {{{{{}}}// ''hier= ***********************************************
Class setSeekBarListener implements SeekBar. OnSeekBarChangeListener {

// μ ± ½ ø È õ µä½ ø ¶ È ¸ ä± äê ± £;» áµó Ó Ã '{?? please refer to the following link for more information: fromUser has been requested during the period of operation: £ ************************************************
// Progress ± í?¾ =%%%» ¬ **********************************************************
@ Override
Public void onProgressChanged (SeekBar seekBar, int progress,
Boolean fromUser ){
// TODO Auto-generated method stub
If (fromUser ){
System. out. println ("user change seekBar to -->" + progress );
} Else {
System. out. println ("system change seekBar to -->" + progress );
}


}


// μ ± Ö ö¶ ¿Ê ¼ ¸ ± ä± ää ø È» ¬ é µäî λ öã ± μ ÷ 'ë · ½ · â
@ Override
Public void onStartTrackingTouch (SeekBar seekBar ){
// TODO Auto-generated method stub
System. out. println ("touch start -->" + seekBar. getProgress ());
}


// μ ± Ê ö¶ ¸ ä±ä» ¬ ¿éî» öã ámímámámámámámámámámámámámámámámámām'{· ¨
@ Override
Public void onStopTrackingTouch (SeekBar seekBar ){
// TODO Auto-generated method stub
System. out. println ("touch stop -->" + seekBar. getProgress ());
}

}


@ Override
Public boolean onCreateOptionsMenu (Menu menu ){
// Inflate the menu; this adds items to the action bar if it is present.
GetMenuInflater (). inflate (R. menu. main, menu );
Return true;
}


}


Ö÷ ² ~~öî ä~~mail. xml £° Xmlns: tools = "http://schemas.android.com/tools"
Android: layout_width = "match_parent"
Android: layout_height = "match_parent"
Android: paddingBottom = "@ dimen/activity_vertical_margin"
Android: paddingLeft = "@ dimen/activity_horizontal_margin"
Android: paddingRight = "@ dimen/activity_horizontal_margin"
Android: paddingTop = "@ dimen/activity_vertical_margin"
Tools: context = ". MainActivity">


Android: id = "@ + id/myText"
Android: layout_width = "wrap_content"
Android: layout_height = "wrap_content"
Android: text = "@ string/hello_world"/>

Android: id = "@ + id/mySeekBar"
Android: layout_width = "fill_parent"
Android: layout_height = "wrap_content"
Android: layout_below = "@ id/myText"
/>





Ê μ Ï öµäð § ¹ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

<Strong · Strong "http://www.bkjia.com/kf/ware/vc/" target = "_ blank" class = "keylink"> Principal + nKsaOsu + G199PDvODM/cb31tC1xM/principal = "" alt = "">


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.