Search in sources :

Example 26 with UsersDataModel

use of com.example.first_responder_app.dataModels.UsersDataModel in project FirstResponse by mattpost1700.

the class MainActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    updateTheme();
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    setupAppBar();
    if (savedInstanceState != null) {
        String user_id = savedInstanceState.getString("user_id");
        String username = savedInstanceState.getString("username");
        String first = savedInstanceState.getString("first");
        String last = savedInstanceState.getString("last");
        if (user_id != null && username != null) {
            UsersDataModel user = new UsersDataModel();
            user.setDocumentId(user_id);
            user.setUsername(username);
            user.setFirst_name(first);
            user.setLast_name(last);
            setActive(user);
        }
    }
}
Also used : UsersDataModel(com.example.first_responder_app.dataModels.UsersDataModel)

Aggregations

UsersDataModel (com.example.first_responder_app.dataModels.UsersDataModel)26 ArrayList (java.util.ArrayList)10 QueryDocumentSnapshot (com.google.firebase.firestore.QueryDocumentSnapshot)9 ActiveUser (com.example.first_responder_app.interfaces.ActiveUser)8 SuppressLint (android.annotation.SuppressLint)6 View (android.view.View)6 ViewModelProvider (androidx.lifecycle.ViewModelProvider)6 NavDirections (androidx.navigation.NavDirections)6 NonNull (androidx.annotation.NonNull)5 NavHostFragment (androidx.navigation.fragment.NavHostFragment)5 FirestoreDatabase (com.example.first_responder_app.FirestoreDatabase)5 TAG (android.content.ContentValues.TAG)4 Context (android.content.Context)4 Bundle (android.os.Bundle)4 Log (android.util.Log)4 Toast (android.widget.Toast)4 Fragment (androidx.fragment.app.Fragment)4 UserViewModel (com.example.first_responder_app.viewModels.UserViewModel)4 List (java.util.List)4 Manifest (android.Manifest)3