parent
0dbdf336d6
commit
96127f8bd1
@ -71,6 +71,7 @@ public class SuRequestActivity extends BaseActivity {
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
lockOrientation();
|
||||
supportRequestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
|
||||
PackageManager pm = getPackageManager();
|
||||
|
@ -4,7 +4,9 @@ import android.Manifest;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.pm.ActivityInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.view.WindowManager;
|
||||
@ -81,6 +83,13 @@ public abstract class BaseActivity extends AppCompatActivity implements Event.Au
|
||||
}
|
||||
}
|
||||
|
||||
protected void lockOrientation() {
|
||||
if (Build.VERSION.SDK_INT < 18)
|
||||
setRequestedOrientation(getResources().getConfiguration().orientation);
|
||||
else
|
||||
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LOCKED);
|
||||
}
|
||||
|
||||
public void runWithExternalRW(Runnable callback) {
|
||||
runWithPermission(new String[] { Manifest.permission.WRITE_EXTERNAL_STORAGE }, callback);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user