无法在Android上全屏显示应用

时间:2016-05-16 11:21:20

标签: android bitmap android-fullscreen

我在活动中创建了一个图像然后显示它。但图像并非全屏,因为它周围有白色边框!屏幕应该同时显示图像和闪光。这是我的Java代码:

@Query("select c from :entity c )

BaseEntity findOne( @Param("value") String entity );

}

这是XML文件(这只是一个活动,应用程序包含另一个活动):

public class DisplayData extends Activity {

    float minBright = 0;
    int patch = 25;


    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);


       this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                WindowManager.LayoutParams.FLAG_FULLSCREEN);
       // super.onCreate(savedInstanceState);// no need to write another    

        //time//
        setContentView(R.layout.activity_display);
        ViewFlipper imageFlipper = (ViewFlipper)findViewById( R.id.image_flipper );

        //I removed the irrelevant part of the code
      ImageView image = new ImageView ( getApplicationContext() );

        image.setImageBitmap(GridBitmap);

        imageFlipper.addView( image );

        imageFlipper.setFlipInterval( 2000 ); 
        imageFlipper.startFlipping();

        Thread thread = new Thread(){

            @Override
            public void run() {
                while (true) {

                    try {
                        synchronized (this) {
                            wait(bl1);

                            runOnUiThread(new Runnable() {
                                @Override
                                public void run() {
                                    WindowManager.LayoutParams layout = getWindow().getAttributes();
                                    layout.screenBrightness = maxBright;

                                    getWindow().setAttributes(layout);
                                }
                            });

                        }
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }


                    try {
                        synchronized (this) {
                            wait(wh1);

                            runOnUiThread(new Runnable() {
                                @Override
                                public void run() {
                                    WindowManager.LayoutParams layout = getWindow().getAttributes();
                                    layout.screenBrightness = minBright;

                                    getWindow().setAttributes(layout);
                                }
                            });

                        }
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                }
            };
        };

        thread.start();

    }

1 个答案:

答案 0 :(得分:0)

只需从布局中删除填充:

String test2=StringEscapeUtils.escapeHtml4("<div class="text-center"> <h1 >hello</h1></div>");