سؤال

I would hide navigation bar and action bar of my app after some second that display don't get touched, and expand current view to fullscreen. Then if user touch the screen (or better if he swipe down), make visible both again. How to?

هل كانت مفيدة؟

المحلول

You can use a Handler to delay certain actions.

 Handler h = new Handler();

 h.postDelayed(new Runnable() {

     @Override
     public void run() {
         // DO DELAYED STUFF
         getActionBar().hide();
     }
 }, delaytime); // e.g. 3000 milliseconds

The actions you take inside the run() method will be executed after the delay-time you set.

نصائح أخرى

If you are using Eclipse, just create a new project and select "Fullscreen Activity": this is a good example on how to do what you want.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top