Код: Выделить всё
MainActivity.javaКод: Выделить всё
package com.example.test;
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
import android.view.ViewGroup.LayoutParams;
import android.view.Gravity;
import android.widget.LinearLayout;
import android.view.WindowManager;
import android.view.View;
import android.view.Window;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
TextView txt = new TextView(this);
txt.setLayoutParams(new LayoutParams(
LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT
));
txt.setText("Hello, world!");
LinearLayout lay = new LinearLayout(this);
lay.setLayoutParams(new LayoutParams(
LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT
));
lay.addView(txt);
setContentView(lay);
}
}
< /code>
AndroidManifest.xml< /code>
And I get

Where are the three nagivation buttons ? Why is there a fullscreen icon at bottom right ? Is this navigation bar or something else ? How do I get the app window sandwiched between status bar and navigation bar ?
I tested this on Xiaomi Redmi Note 5 Pro (APILEVEL=28).
Подробнее здесь: https://stackoverflow.com/questions/794 ... ello-world