Advertisement
tlmarker1968

My onCreate method

Dec 19th, 2019
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.65 KB | None | 0 0
  1.     /**
  2.      * This method will create the activity, read content to display, and show the main activity screen
  3.      * Used when the activity is (re)created.
  4.      *
  5.      * @param savedInstanceState current saved instance state
  6.      */
  7.     @Override
  8.     protected void onCreate(Bundle savedInstanceState) {
  9.         super.onCreate(savedInstanceState);
  10.         getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
  11.         View decorView = getWindow().getDecorView();
  12.         decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN);
  13.         setContentView(R.layout.activity_home);
  14.         etUsername = findViewById(R.id.etUsername);
  15.         etPassword = findViewById(R.id.etPassword);
  16.         TextView tvWarning = findViewById(R.id.tvWarning);
  17.         Button btnLogon = findViewById(R.id.btnLogon);
  18.         btnLogon.setOnClickListener(this);
  19.         @SuppressLint ("Recycle") Cursor cursor = getContentResolver().query(Uri.parse("content://com.phoenixhospman.install.ProviderSettings/settings"), null, null, null, null, null);
  20.         assert cursor != null;
  21.         if(cursor.moveToFirst()) {
  22.             while(!cursor.isAfterLast()) {
  23.                 strCoName = cursor.getString(cursor.getColumnIndex("coname"));
  24.                 strApiUrl = cursor.getString(cursor.getColumnIndex("apiurl"));
  25.                 cursor.moveToNext();
  26.             }
  27.         } else {
  28.             Error("\nRequired setting missing.\nPlease (re)run Phoenix Install App");
  29.         }
  30.         managerLauncherApi = new ManagerLauncherApi(strApiUrl);
  31.         tvWarning.setText(getString(R.string.warning, rtrim(strCoName) ));
  32.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement