Popular posts from this blog
How to write bangla language in Android Studio
Building Bangla Supported Android Application in Android Studio is possible by using custom typeface. Just Do the following steps that i described Step1 : Go To Android Project main and make a new Directory named "assets" Step2: Now Again make another new directory among assets file named "fonts" Step3: Now Download Kalpurush font from here as .ttf file format. Step4: Copy And Paste this Bangla font to your fonts directory in android studio. Step5: Write some code at your ActivityMain.Java Button btn; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); btn= (Button) findViewById(R.id.button); Typeface myCoustomFont=Typeface.createFromAsset(getAssets(),"fonts/kalpurush.ttf"); btn.setTypeface(myCoustomFont); Step6: ActivityMain.xml will looks like
How to create Switch with SSwitch Control with setOnCheckedChangeListener
Step-01:Create a Switch First.. Step-02: Write Some Java Code And Set OnCheckedChangeListener for switch MainActivity.Java public class MainActivity extends AppCompatActivity { private Switch aSwitch; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); aSwitch= (Switch) findViewById(R.id.switchId); aSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { if(isChecked) { Toast.makeText(getApplicationContext(),"ON", Toast.LENGTH_SHORT).show(); } else { Toast.makeText(getApplicationContext(),"OFF", Toast.LENGTH_SHORT).show(); } } ...
Comments
Post a Comment