android - 禁用向下拖动通知栏的功能

时间:2010-04-08 14:18:14

标签: android

我正在做一个Android应用程序,我知道可以显示或隐藏通知栏。

但是有没有办法显示它但禁用拖动它的能力?

由于

2 个答案:

答案 0 :(得分:3)

嗯,我认为那是不可能的,但是你可以实现类似的活动FullScreen。

public class FullScreen extends Activity {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        requestWindowFeature(Window.FEATURE_NO_TITLE);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, 
                                WindowManager.LayoutParams.FLAG_FULLSCREEN);

        setContentView(R.layout.main);
    }
}

Jorgesys

答案 1 :(得分:1)

public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);


Log.d("Focus debug", "Focus changed !");

if(!hasFocus) {
Log.d("Focus debug", "Lost focus !");

Intent closeDialog = new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
sendBroadcast(closeDialog);
}
}