Home>

Why codefindViewById (R.id.connectServer) .setVisibility (View.GONE);doesn't hide the View, but if you run the codeSystem.out.println (findViewById (R.id.connectServer) .getVisibility ()== View.GONE);then it outputstrue
Please tell me why this is happening?

package absolutely.secret;
import *;
public class abc extends AppCompatActivity {
    @SuppressLint ({"StaticFieldLeak", "SetTextI18n"})
    @Override
    protected void onCreate (Bundle savedInstanceState) {
        super.onCreate (savedInstanceState);
       setRequestedOrientation (ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
        requestWindowFeature (Window.FEATURE_NO_TITLE);
        setContentView (R.layout.abc);
new AsyncTask <
Integer, Integer, Integer >
() {
                @SuppressLint ("StaticFieldLeak")
                @Override
                protected Integer doInBackground (Integer ... voids) {
                    //...
publishProgress ();
                    return null;
                }
                @Override
                protected void onProgressUpdate (Integer ... values) {
                    super.onProgressUpdate (values);
findViewById (R.id.connectServer) .setVisibility (View.GONE);
findViewById (R.id.abc) .setVisibility (View.VISIBLE);
}
} .execute ();
}
}


Markup code:

<
? xml version= "1.0" encoding= "utf-8"? >
<
RelativeLayout
    xmlns: android= "http://schemas.android.com/apk/res/android"
    xmlns: app= "http://schemas.android.com/apk/res-auto"
    xmlns: tools= "http://schemas.android.com/tools"
    android: layout_height= "match_parent"
    android: layout_width= "match_parent" >
    <
include android: id= "@ + id /abc" layout= "@ layout /activity_abc" />
    <
FrameLayout
        android: id= "@ + id /connectServer"
        android: layout_width= "match_parent"
        android: layout_height= "match_parent" >
        <
LinearLayout
            android: layout_width= "match_parent"
            android: layout_height= "match_parent"
            android: gravity= "center"
            android: orientation= "vertical"
            tools: context= ". client_wifi" >
            <
TextView
            android: gravity= "center"
            android: layout_gravity= "center"
            android: layout_width= "match_parent"
            android: layout_height= "wrap_content"
            android: textColor= "@ color /white"
            android: textSize= "20dp"
            android: textStyle= "bold"
            android: text= "@ string /..."
                />
            <
TextView
            android: id= "@ + id /code"
            android: gravity= "center"
            android: layout_gravity= "center"
            android: layout_width= "wrap_content"
            android: layout_height= "wrap_content"
            android: textColor= "@ color /black"
            android: background= "@ drawable /..."
            android: textSize= "20dp"
            android: textStyle= "italic | bold"
                />
        <
/LinearLayout >
    <
/FrameLayout >
<
/RelativeLayout >


P.S. connectServer is FrameLayout

Can I have the markup code and the code itself?

Arty Morris2021-02-23 13:11:02

Everything, posted :-)

JAVA JS HTML CSS2021-02-23 13:22:55