In my program I have a preference activity that is set to return a result. I dont actually care what the result is i just want to know when it returns.
The code below is the OnActivityResult function. The activity calls the function correctly except when the array of TextViews (F) is set to Invisible they don't disappear. getInvisibility() returns invisible if called right after it is set but if called later it doesn't. If setVisibility(View.INVISIBLE) is called any other time on F in my program it works perfectly.
The code below the for loops is another array of TextViews (L) and that setText works just like it is supposed to.
Is there something wrong with my code or is there another issue with setVisibility() in onActivityResult()?
when I changed the code to this it worked
but I dont want to change the text I want to make it invisible.
Why does the setText()function work but the setVisibility() function not work?
The code below is the OnActivityResult function. The activity calls the function correctly except when the array of TextViews (F) is set to Invisible they don't disappear. getInvisibility() returns invisible if called right after it is set but if called later it doesn't. If setVisibility(View.INVISIBLE) is called any other time on F in my program it works perfectly.
The code below the for loops is another array of TextViews (L) and that setText works just like it is supposed to.
Is there something wrong with my code or is there another issue with setVisibility() in onActivityResult()?
Code:
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data){
for(int i = 0; i < MAXPLAYERS; i++){
for(int j = 0; j < 3; j++){
F[i][j].setVisibility(View.INVISIBLE);
//This does not make the texviews invisible even though F[i][j].getVisibility() will return View.INVISIBLE
}
}
L[0].setText(settings.getString("Player1", getString(R.string.Player1)));//This works perfectly
}
Code:
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data){
for(int i = 0; i < MAXPLAYERS; i++){
for(int j = 0; j < 3; j++){
F[i][j].setText("");//This works perfectly but not what I want to do
}
}
L[0].setText(settings.getString("Player1", getString(R.string.Player1)));//This works perfectly
}
Why does the setText()function work but the setVisibility() function not work?