I'm trying to make an Android app that hides both the notification bar and the action bar (back to the start, etc), so I had thought about creating a service that hides the action bar because the notification bar does not I have a problem but when creating it I am forced to use both Service
and Activity
, this gives me the error in Activity
:
Interface expected here
my code:
import android.app.Activity;
import android.app.Service;
import android.content.Intent;
import android.os.Build;
import android.os.IBinder;
import android.support.annotation.RequiresApi;
import android.view.View;
public class FirstService extends Service implements Activity{
@Override
public IBinder onBind(Intent arg0) {
return null;
}
@RequiresApi(api = Build.VERSION_CODES.HONEYCOMB)
public void onStart(Intent intent, int startId) {
super.onStart(intent, startId);
View view = findViewById(R.id.activity_main);
view.setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);
this.stopSelf();
}
public void onDestroy() {
super.onDestroy();
}
}
Thanks for your help.