Hello friends in this video we have shown How to Display a String List in a Dialog Box in Sketchware. Hope you all will like the video. Do like the video. Also do subscribe our channel for more such videos. Hope you will learn something new from the video. Also if you get any issues in this then do bring it into our notice so that we can solve it.
The code used:-
dialog.setAdapter(
new ArrayAdapter(MainActivity.this, android.R.layout.simple_list_item_1, list),
new DialogInterface.OnClickListener(){
@Override
public void onClick(DialogInterface _di, int _pos){
textview1.setText(list.get(_pos));
if (_pos == 0) {
i.setClass(getApplicationContext(), GoogleActivity.class);
startActivity(i);
}
if (_pos == 1) {
i.setClass(getApplicationContext(), YoutubeActivity.class);
startActivity(i);
}
if (_pos == 2) {
i.setClass(getApplicationContext(), AdmobActivity.class);
startActivity(i);
}
if (_pos == 3) {
i.setClass(getApplicationContext(), AdsenseActivity.class);
startActivity(i);
}
}} );
Part 1:- • How to Display a String List in a Dialog B...
#sketchware #scratch #android #app