1
MainActivity.classAndroid - 如何從另一種方法獲取值字符串?
public class MainActivity extends AppCompatActivity {
....
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
.....
Button btnGenerate = (Button) findViewById(R.id.btn_generate);
etInput = (EditText) findViewById(R.id.input_username);
tvTampil = (TextView) findViewById(R.id.tittle);
btnGenerate.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
showProgressDialog();
tvTampil.setText(etInput.getText().toString());
anjay = tvTampil.getText().toString();
}
});
}
private void showProgressDialog() {
final MaterialStyledDialog.Builder popup = new MaterialStyledDialog.Builder(context)
.setTitle(anjay)
.setDescription("Please check your diamond and battle point now")
.setPositiveText("Thanks");
....
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
public void run() {
progressDialog.dismiss();
popup.show();
}
}, 3000);
}
我用我的編碼,但不會出現。 我想發送值edittext到.setTittle MaterialStyledDialog。
感謝
不能明白你想要什麼。 –