Click here to Skip to main content
15,793,276 members
Home / Discussions / Android
   

Android

 
GeneralRe: Suitable Laptop Model for Android Development Pin
phoohtoo20-Jan-21 6:21
phoohtoo20-Jan-21 6:21 
AnswerRe: Suitable Laptop Model for Android Development Pin
thatraja19-Jan-21 6:41
professionalthatraja19-Jan-21 6:41 
GeneralRe: Suitable Laptop Model for Android Development Pin
phoohtoo20-Jan-21 6:19
phoohtoo20-Jan-21 6:19 
Questioncreation of login page in android studio Pin
Member 150388016-Jan-21 1:00
Member 150388016-Jan-21 1:00 
QuestionRe: creation of login page in android studio Pin
Richard MacCutchan6-Jan-21 1:25
mveRichard MacCutchan6-Jan-21 1:25 
Rant[REPOST] creation of login page in android studio Pin
Richard Deeming6-Jan-21 1:26
mveRichard Deeming6-Jan-21 1:26 
GeneralRe: [REPOST] creation of login page in android studio Pin
Richard MacCutchan6-Jan-21 1:26
mveRichard MacCutchan6-Jan-21 1:26 
QuestionHow to get string value after updating string Pin
Member 150370094-Jan-21 4:42
Member 150370094-Jan-21 4:42 
Today I come to you with one question - I am currently creating an Android application that works with the firestore and implemented a class that checks the account type. Everything works fine, however I would now like to get the value of "typeOfAcc" from this class in a different class as it will be the path to my document in the database, however, there is one condition - the path must be downloaded only after the data is downloaded from the database and based on it it will be determined whether the account type should be changed to "Trainers". Anyone have any idea? All my attempts so far have ended with the second class just getting this string before changing its value, resulting in no access to data. Checking the logs, everything is fine, the value changes, but unfortunately after getting the value. Thanks in advance for your help!

```
public class UserValid
{
    String typeOfAcc = "Podopieczni";
    FirebaseFirestore fStore;
    FirebaseAuth fAuth;
    DocumentReference documentReference;
    List itemList = new ArrayList<>();
    String userID;

    public UserValid()
    {
        Log.d("TAG", "Błąd, wybrano konstruktor bez argumentów");
    }

    //Metoda sprawdzająca jaki typ konta jest aktualnie obsługiwany
    // Jeśli wartość true - konto podopiecznego, wartość false - konto trenera;
    public UserValid(FirebaseAuth fAuth, FirebaseFirestore fStore)
    {
        userID = fAuth.getCurrentUser().getUid();
        this.fAuth = fAuth;
        this.fStore = fStore;
        documentReference = fStore.collection("Podopieczni").document(userID);

        readData(new FirestoreCallback()
        {
            @Override
            public void onCallback(List<String> list)
            {
                if(itemList.get(0) == null)
                {
                    typeOfAcc="Trenerzy";
                    Log.d("TAG", itemList.toString());

                }
            }
        });


    }
    private void readData(FirestoreCallback firestoreCallback)
    {
        //DocumentReference docRef = db.collection("cities").document("SF");
        documentReference.get().addOnCompleteListener(new OnCompleteListener<DocumentSnapshot>() {
            @Override
            public void onComplete(@NonNull Task<DocumentSnapshot> task) {
                if (task.isSuccessful())
                {

                    //for(DocumentSnapshot document : task.getResult()) {
                        String itemName = task.getResult().getString("Imie");
                        itemList.add(itemName);

                   // }
                    firestoreCallback.onCallback(itemList);
                }
            }

        });
    }



    private interface FirestoreCallback
    {
        void onCallback(List<String> list);
    }
}
```

SuggestionRe: How to get string value after updating string Pin
David Crow4-Jan-21 9:54
David Crow4-Jan-21 9:54 
QuestionHow to check username and password?? Pin
Member 1502640222-Dec-20 21:50
Member 1502640222-Dec-20 21:50 
AnswerRe: How to check username and password?? Pin
Richard MacCutchan22-Dec-20 23:00
mveRichard MacCutchan22-Dec-20 23:00 
AnswerRe: How to check username and password?? Pin
Mycroft Holmes23-Dec-20 12:18
professionalMycroft Holmes23-Dec-20 12:18 
QuestionHow to use .net Webservice in Android?? Pin
Member 1502640220-Dec-20 20:52
Member 1502640220-Dec-20 20:52 
AnswerRe: How to use .net Webservice in Android?? Pin
Sandeep Mewara20-Dec-20 21:14
mveSandeep Mewara20-Dec-20 21:14 
GeneralRe: How to use .net Webservice in Android?? Pin
Member 1502640220-Dec-20 21:44
Member 1502640220-Dec-20 21:44 
AnswerRe: How to use .net Webservice in Android?? Pin
OriginalGriff20-Dec-20 21:47
mvaOriginalGriff20-Dec-20 21:47 
QuestionRF (Radio Frequency) Device Scan & Warehouse Management System Pin
johncodeproject16-Dec-20 20:42
johncodeproject16-Dec-20 20:42 
AnswerRe: RF (Radio Frequency) Device Scan & Warehouse Management System Pin
davidgermain18-Dec-20 2:44
davidgermain18-Dec-20 2:44 
QuestionAndroid studio ListView Pin
Shuhrat Rahimov16-Oct-20 20:28
Shuhrat Rahimov16-Oct-20 20:28 
AnswerRe: Android studio ListView Pin
OriginalGriff16-Oct-20 21:21
mvaOriginalGriff16-Oct-20 21:21 
AnswerRe: Android studio ListView Pin
Richard MacCutchan16-Oct-20 22:54
mveRichard MacCutchan16-Oct-20 22:54 
Questionandroid put loading message when load another acitvity Pin
GongTji17-Sep-20 2:29
GongTji17-Sep-20 2:29 
QuestionRe: android put loading message when load another acitvity Pin
David Crow17-Sep-20 5:36
David Crow17-Sep-20 5:36 
AnswerRe: android put loading message when load another acitvity Pin
GongTji20-Sep-20 1:27
GongTji20-Sep-20 1:27 
GeneralRe: android put loading message when load another acitvity Pin
David Crow20-Sep-20 5:45
David Crow20-Sep-20 5:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.