Hello to everyone..
So this is test code to understand what Im tolking about:
So basically what i need is
let]s say I have incoming data which is new evry time I grab it then I need to print that In text view fron the new line \n but what ever I do it's reprints the previous incoming data so avoid that I found this way see my code...
But I pretty sure this is NOT right way because the Text view reprints the StrM string evry time and also which even more to it it's expends every time. Now it's like Text View buffer but Im pretty sure here suppose to be its own Text view buffer. So here the question by the way how big the StrM can be.????..
So pls for those who know what's the efficiant way of same what's this code do???
So this is test code to understand what Im tolking about:
So basically what i need is
let]s say I have incoming data which is new evry time I grab it then I need to print that In text view fron the new line \n but what ever I do it's reprints the previous incoming data so avoid that I found this way see my code...
But I pretty sure this is NOT right way because the Text view reprints the StrM string evry time and also which even more to it it's expends every time. Now it's like Text View buffer but Im pretty sure here suppose to be its own Text view buffer. So here the question by the way how big the StrM can be.????..
So pls for those who know what's the efficiant way of same what's this code do???
Code:
String incoming_data;
String StrM;
textView = (TextView) findViewById(R.id.text_print_view);
textView.setMovementMethod(new ScrollingMovementMethod());
textView.setSingleLine(false);
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.btn_send:
incoming_data = textEdit.getText().toString();
StrM = StrM +"\n" + incoming_data ;
textView.setText(StrM);
break;
case R.id.btn_clear:
textView.setText("");
StrM = "";
break;
.