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
Everything, posted :-)
JAVA JS HTML CSS2021-02-23 13:22:55Related questions
- java : How do I display View from the very top of the screen?
- java : OnBackPressed for each item in custom NavigatorView
- Handler threads problem; java
- java : How to fix realm initialization error
- Android Java, full screen screenshot
- java : You need to change the Switch value of the element created programmatically via BroadcastReceiver
- java : The RecyclerView does not display the entire list
- java : how to remove text from Toolbar (android studio)?
- java : Why is the program execution speed so different?
Can I have the markup code and the code itself?
Arty Morris2021-02-23 13:11:02