再次。我創建的應用程序通過在Dialog Alert
中使用SeekBar來更改TextSize。當我使用seekBar
TextSize
將更改並顯示字體編號Toast.makeText
。但Toast.makeTake
不停止增加號碼,顯示消息。當對話關閉和退出應用程序時,它不會停止。我必須在設置或卸載應用程序中強制關閉應用程序。這將停止。我怎樣才能解決這個問題。 再次感謝。如何停止Toast.makeText當關閉對話框或退出應用程序
public void ShowDialog() {
final AlertDialog.Builder popDialog = new AlertDialog.Builder(this);
final SeekBar seek = new SeekBar(this);
seek.setMax(100);
popDialog.setIcon(R.drawable.conp);
popDialog.setTitle(R.string.menu_settings);
popDialog.setView(seek);
seek.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
public void onProgressChanged(SeekBar seekBar, int progress,
boolean fromUser) {
subtitles.setTextSize(progress);
Toast.makeText(ShowMan.this, "your textsize :" + String.valueOf(progress), Toast.LENGTH_LONG).show();
}
public void onStartTrackingTouch(SeekBar arg0) {
// TODO Auto-generated method stub
}
public void onStopTrackingTouch(SeekBar seekBar) {
// TODO Auto-generated method stub
}
});
// Button
popDialog.setPositiveButton("OK",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
});
popDialog.create();
popDialog.show();
}
&我的老師說:「不要用對話框主題。
我只是想關閉對話框Toast.makeTake解僱和停止增加時?號我怎樣才能解決這個 – T2terBKK
與此2. Toast.makeText(ShowMan.this, 「你TEXTSIZE:」 +將String.valueOf(進度),Toast.LENGTH_SHORT).show(); Toast.makeText(表演者。這個「你的textsize:」+ String.valueOf(進度) ,2000).show();不行。 – T2terBKK