How to write this code in extension
mSeekBar = (SeekBar) findViewById(R.id.mSeekBar);
How to write this code in extension
mSeekBar = (SeekBar) findViewById(R.id.mSeekBar);
You could do that easily:
First, initialize the activity or context
private final Activity activity;
public MyExtension(final ComponentContainer container) {
super(container.$form());
activity = container.$context();
}
Creating seek bar
@SimpleFunction
public void AddSeekbarToArrangement(AndroidViewComponent component) {
// Create the frame layout
FrameLayout componentLayout = (FrameLayout) component.getView();
// Create a new seekbar with the activity or context
SeekBar seekBar = new SeekBar(this.activity);
// Set settings whatever you want
seekBar.setMax(30);
seekBar.setProgress(10);
// Add to framelayout (arrangement)
componentLayout.addView(seekBar);
}
And you get a seek bar created.