I am trying to access the edttxt
value that exists in class Mainactivity
, this is contained in class Mainactivity
:
Button btn=(Button)findViewById(R.id.btn);
btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
EditText edttxt =(EditText)findViewById(R.id.edttxt);
TextView txtview =(TextView)findViewById(R.id.textView);
txtview.setText(edttxt.getText().toString());
}
});
The access I need is to replace the 100 values by edttxt value in the other class, this is part I need to modify the other class:
public void switchFlash() {
final Runnable runnable = new Runnable() {
@Override
public void run() {
if (isFlashOn()) {
turnOffFlash();
x++;
} else if (x>20) {
turnOffFlash();
}
else
{
turnOnFlash();
}
handler.postDelayed(this,100);
}
};
handler.postDelayed(runnable,100);
}