Don't get Data from Firestore on my TextView
I tryed to show up text on the TextView which i'm saved with the saveQuote methode on Firestore, but just recieve null. I'm also had some problems by doing this with the "normal" database from Firebase. I definded the OnClick mthode for the buttons on the xml. Can someone maybe tell me how to fix that problem ? My logcat say "E/memtrack: Couldn't load memtrack module", "GCM_HB_ALARM release without a matched acquire!" and " Not supplying enough data to HAL, expected position".
public class MainActivity extends AppCompatActivity {
private static final String TAG = "InspiringQuote";
public static final String AUTHOR_KEY = "author";
public static final String QUOTE_KEY = "quote";
private TextView textViewData;
private DocumentReference mDocRef = FirebaseFirestore.getInstance().document("sampleData/inspiration");
TextView mQuoteTextView;
private FirebaseFirestore db = FirebaseFirestore.getInstance();
private CollectionReference noteRef = db.collection("inspiration");
private Toolbar toolbar;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//mQuoteTextView = (TextView) findViewById(R.id.text_view_data);
textViewData = (TextView) findViewById(R.id.text_view_data);
//Toolbar Options
//toolbar = (Toolbar) findViewById(R.id.testToolbar);
//setSupportActionBar(toolbar);
//getSupportActionBar().setTitle("HomePage");
//getSupportActionBar().setDisplayHomeAsUpEnabled(true);
//
}
public void saveQuote(View view){
EditText quoteView = (EditText) findViewById(R.id.editTextQuote);
EditText authorVIew = (EditText) findViewById(R.id.editTextAuthor);
String quoteText = quoteView.getText().toString();
String authorText = authorVIew.getText().toString();
if (quoteText.isEmpty() || authorText.isEmpty()){return;}
Map<String, Object> dataToSave = new HashMap<String, Object>();
dataToSave.put("QUOTE_KEY", quoteText);
dataToSave.put("AUTHOR_KEY", authorText);
mDocRef.set(dataToSave).addOnSuccessListener(new OnSuccessListener<Void>() {
@Override
public void onSuccess(Void aVoid) {
Log.d(TAG, "Document has been saved");
}
}).addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {
Log.w(TAG, "Document was not saved", e);
}
});
}
public void loadNote(View v){
mDocRef.get()
.addOnSuccessListener(new OnSuccessListener<DocumentSnapshot>() {
@Override
public void onSuccess(DocumentSnapshot documentSnapshot) {
if(documentSnapshot.exists()){
String title = documentSnapshot.getString(QUOTE_KEY);
String description = documentSnapshot.getString(AUTHOR_KEY);
//Map<String, Object> note = documentSnapshot.getData();
textViewData.setText("Title" + title + "n" + "Description: " + description);
}else{
Toast.makeText(MainActivity.this, "Document does not exits", Toast.LENGTH_SHORT);
}
}
})
.addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {
Toast.makeText(MainActivity.this, "ERROR", Toast.LENGTH_SHORT).show();
Log.d(TAG, e.toString());
}
});
}
}
In the imgae you can see that im recieving "null"
android firebase google-cloud-firestore
add a comment |
I tryed to show up text on the TextView which i'm saved with the saveQuote methode on Firestore, but just recieve null. I'm also had some problems by doing this with the "normal" database from Firebase. I definded the OnClick mthode for the buttons on the xml. Can someone maybe tell me how to fix that problem ? My logcat say "E/memtrack: Couldn't load memtrack module", "GCM_HB_ALARM release without a matched acquire!" and " Not supplying enough data to HAL, expected position".
public class MainActivity extends AppCompatActivity {
private static final String TAG = "InspiringQuote";
public static final String AUTHOR_KEY = "author";
public static final String QUOTE_KEY = "quote";
private TextView textViewData;
private DocumentReference mDocRef = FirebaseFirestore.getInstance().document("sampleData/inspiration");
TextView mQuoteTextView;
private FirebaseFirestore db = FirebaseFirestore.getInstance();
private CollectionReference noteRef = db.collection("inspiration");
private Toolbar toolbar;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//mQuoteTextView = (TextView) findViewById(R.id.text_view_data);
textViewData = (TextView) findViewById(R.id.text_view_data);
//Toolbar Options
//toolbar = (Toolbar) findViewById(R.id.testToolbar);
//setSupportActionBar(toolbar);
//getSupportActionBar().setTitle("HomePage");
//getSupportActionBar().setDisplayHomeAsUpEnabled(true);
//
}
public void saveQuote(View view){
EditText quoteView = (EditText) findViewById(R.id.editTextQuote);
EditText authorVIew = (EditText) findViewById(R.id.editTextAuthor);
String quoteText = quoteView.getText().toString();
String authorText = authorVIew.getText().toString();
if (quoteText.isEmpty() || authorText.isEmpty()){return;}
Map<String, Object> dataToSave = new HashMap<String, Object>();
dataToSave.put("QUOTE_KEY", quoteText);
dataToSave.put("AUTHOR_KEY", authorText);
mDocRef.set(dataToSave).addOnSuccessListener(new OnSuccessListener<Void>() {
@Override
public void onSuccess(Void aVoid) {
Log.d(TAG, "Document has been saved");
}
}).addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {
Log.w(TAG, "Document was not saved", e);
}
});
}
public void loadNote(View v){
mDocRef.get()
.addOnSuccessListener(new OnSuccessListener<DocumentSnapshot>() {
@Override
public void onSuccess(DocumentSnapshot documentSnapshot) {
if(documentSnapshot.exists()){
String title = documentSnapshot.getString(QUOTE_KEY);
String description = documentSnapshot.getString(AUTHOR_KEY);
//Map<String, Object> note = documentSnapshot.getData();
textViewData.setText("Title" + title + "n" + "Description: " + description);
}else{
Toast.makeText(MainActivity.this, "Document does not exits", Toast.LENGTH_SHORT);
}
}
})
.addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {
Toast.makeText(MainActivity.this, "ERROR", Toast.LENGTH_SHORT).show();
Log.d(TAG, e.toString());
}
});
}
}
In the imgae you can see that im recieving "null"
android firebase google-cloud-firestore
Not sure about this but try - String title = documentSnapshot.getString("QUOTE_KEY"); and same for the Author_key... probably need to declare a string.
– Nero
Nov 18 '18 at 22:06
What do you exactly mean ? I did this in the loadNote methode.
– Testik
Nov 19 '18 at 7:34
Now i understood you.THANK YOU it works now !!
– Testik
Nov 19 '18 at 8:54
I've added the answer, can you please accept it to take it off the unanswered question list.
– Nero
Nov 21 '18 at 20:11
add a comment |
I tryed to show up text on the TextView which i'm saved with the saveQuote methode on Firestore, but just recieve null. I'm also had some problems by doing this with the "normal" database from Firebase. I definded the OnClick mthode for the buttons on the xml. Can someone maybe tell me how to fix that problem ? My logcat say "E/memtrack: Couldn't load memtrack module", "GCM_HB_ALARM release without a matched acquire!" and " Not supplying enough data to HAL, expected position".
public class MainActivity extends AppCompatActivity {
private static final String TAG = "InspiringQuote";
public static final String AUTHOR_KEY = "author";
public static final String QUOTE_KEY = "quote";
private TextView textViewData;
private DocumentReference mDocRef = FirebaseFirestore.getInstance().document("sampleData/inspiration");
TextView mQuoteTextView;
private FirebaseFirestore db = FirebaseFirestore.getInstance();
private CollectionReference noteRef = db.collection("inspiration");
private Toolbar toolbar;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//mQuoteTextView = (TextView) findViewById(R.id.text_view_data);
textViewData = (TextView) findViewById(R.id.text_view_data);
//Toolbar Options
//toolbar = (Toolbar) findViewById(R.id.testToolbar);
//setSupportActionBar(toolbar);
//getSupportActionBar().setTitle("HomePage");
//getSupportActionBar().setDisplayHomeAsUpEnabled(true);
//
}
public void saveQuote(View view){
EditText quoteView = (EditText) findViewById(R.id.editTextQuote);
EditText authorVIew = (EditText) findViewById(R.id.editTextAuthor);
String quoteText = quoteView.getText().toString();
String authorText = authorVIew.getText().toString();
if (quoteText.isEmpty() || authorText.isEmpty()){return;}
Map<String, Object> dataToSave = new HashMap<String, Object>();
dataToSave.put("QUOTE_KEY", quoteText);
dataToSave.put("AUTHOR_KEY", authorText);
mDocRef.set(dataToSave).addOnSuccessListener(new OnSuccessListener<Void>() {
@Override
public void onSuccess(Void aVoid) {
Log.d(TAG, "Document has been saved");
}
}).addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {
Log.w(TAG, "Document was not saved", e);
}
});
}
public void loadNote(View v){
mDocRef.get()
.addOnSuccessListener(new OnSuccessListener<DocumentSnapshot>() {
@Override
public void onSuccess(DocumentSnapshot documentSnapshot) {
if(documentSnapshot.exists()){
String title = documentSnapshot.getString(QUOTE_KEY);
String description = documentSnapshot.getString(AUTHOR_KEY);
//Map<String, Object> note = documentSnapshot.getData();
textViewData.setText("Title" + title + "n" + "Description: " + description);
}else{
Toast.makeText(MainActivity.this, "Document does not exits", Toast.LENGTH_SHORT);
}
}
})
.addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {
Toast.makeText(MainActivity.this, "ERROR", Toast.LENGTH_SHORT).show();
Log.d(TAG, e.toString());
}
});
}
}
In the imgae you can see that im recieving "null"
android firebase google-cloud-firestore
I tryed to show up text on the TextView which i'm saved with the saveQuote methode on Firestore, but just recieve null. I'm also had some problems by doing this with the "normal" database from Firebase. I definded the OnClick mthode for the buttons on the xml. Can someone maybe tell me how to fix that problem ? My logcat say "E/memtrack: Couldn't load memtrack module", "GCM_HB_ALARM release without a matched acquire!" and " Not supplying enough data to HAL, expected position".
public class MainActivity extends AppCompatActivity {
private static final String TAG = "InspiringQuote";
public static final String AUTHOR_KEY = "author";
public static final String QUOTE_KEY = "quote";
private TextView textViewData;
private DocumentReference mDocRef = FirebaseFirestore.getInstance().document("sampleData/inspiration");
TextView mQuoteTextView;
private FirebaseFirestore db = FirebaseFirestore.getInstance();
private CollectionReference noteRef = db.collection("inspiration");
private Toolbar toolbar;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//mQuoteTextView = (TextView) findViewById(R.id.text_view_data);
textViewData = (TextView) findViewById(R.id.text_view_data);
//Toolbar Options
//toolbar = (Toolbar) findViewById(R.id.testToolbar);
//setSupportActionBar(toolbar);
//getSupportActionBar().setTitle("HomePage");
//getSupportActionBar().setDisplayHomeAsUpEnabled(true);
//
}
public void saveQuote(View view){
EditText quoteView = (EditText) findViewById(R.id.editTextQuote);
EditText authorVIew = (EditText) findViewById(R.id.editTextAuthor);
String quoteText = quoteView.getText().toString();
String authorText = authorVIew.getText().toString();
if (quoteText.isEmpty() || authorText.isEmpty()){return;}
Map<String, Object> dataToSave = new HashMap<String, Object>();
dataToSave.put("QUOTE_KEY", quoteText);
dataToSave.put("AUTHOR_KEY", authorText);
mDocRef.set(dataToSave).addOnSuccessListener(new OnSuccessListener<Void>() {
@Override
public void onSuccess(Void aVoid) {
Log.d(TAG, "Document has been saved");
}
}).addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {
Log.w(TAG, "Document was not saved", e);
}
});
}
public void loadNote(View v){
mDocRef.get()
.addOnSuccessListener(new OnSuccessListener<DocumentSnapshot>() {
@Override
public void onSuccess(DocumentSnapshot documentSnapshot) {
if(documentSnapshot.exists()){
String title = documentSnapshot.getString(QUOTE_KEY);
String description = documentSnapshot.getString(AUTHOR_KEY);
//Map<String, Object> note = documentSnapshot.getData();
textViewData.setText("Title" + title + "n" + "Description: " + description);
}else{
Toast.makeText(MainActivity.this, "Document does not exits", Toast.LENGTH_SHORT);
}
}
})
.addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {
Toast.makeText(MainActivity.this, "ERROR", Toast.LENGTH_SHORT).show();
Log.d(TAG, e.toString());
}
});
}
}
In the imgae you can see that im recieving "null"
public class MainActivity extends AppCompatActivity {
private static final String TAG = "InspiringQuote";
public static final String AUTHOR_KEY = "author";
public static final String QUOTE_KEY = "quote";
private TextView textViewData;
private DocumentReference mDocRef = FirebaseFirestore.getInstance().document("sampleData/inspiration");
TextView mQuoteTextView;
private FirebaseFirestore db = FirebaseFirestore.getInstance();
private CollectionReference noteRef = db.collection("inspiration");
private Toolbar toolbar;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//mQuoteTextView = (TextView) findViewById(R.id.text_view_data);
textViewData = (TextView) findViewById(R.id.text_view_data);
//Toolbar Options
//toolbar = (Toolbar) findViewById(R.id.testToolbar);
//setSupportActionBar(toolbar);
//getSupportActionBar().setTitle("HomePage");
//getSupportActionBar().setDisplayHomeAsUpEnabled(true);
//
}
public void saveQuote(View view){
EditText quoteView = (EditText) findViewById(R.id.editTextQuote);
EditText authorVIew = (EditText) findViewById(R.id.editTextAuthor);
String quoteText = quoteView.getText().toString();
String authorText = authorVIew.getText().toString();
if (quoteText.isEmpty() || authorText.isEmpty()){return;}
Map<String, Object> dataToSave = new HashMap<String, Object>();
dataToSave.put("QUOTE_KEY", quoteText);
dataToSave.put("AUTHOR_KEY", authorText);
mDocRef.set(dataToSave).addOnSuccessListener(new OnSuccessListener<Void>() {
@Override
public void onSuccess(Void aVoid) {
Log.d(TAG, "Document has been saved");
}
}).addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {
Log.w(TAG, "Document was not saved", e);
}
});
}
public void loadNote(View v){
mDocRef.get()
.addOnSuccessListener(new OnSuccessListener<DocumentSnapshot>() {
@Override
public void onSuccess(DocumentSnapshot documentSnapshot) {
if(documentSnapshot.exists()){
String title = documentSnapshot.getString(QUOTE_KEY);
String description = documentSnapshot.getString(AUTHOR_KEY);
//Map<String, Object> note = documentSnapshot.getData();
textViewData.setText("Title" + title + "n" + "Description: " + description);
}else{
Toast.makeText(MainActivity.this, "Document does not exits", Toast.LENGTH_SHORT);
}
}
})
.addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {
Toast.makeText(MainActivity.this, "ERROR", Toast.LENGTH_SHORT).show();
Log.d(TAG, e.toString());
}
});
}
}
public class MainActivity extends AppCompatActivity {
private static final String TAG = "InspiringQuote";
public static final String AUTHOR_KEY = "author";
public static final String QUOTE_KEY = "quote";
private TextView textViewData;
private DocumentReference mDocRef = FirebaseFirestore.getInstance().document("sampleData/inspiration");
TextView mQuoteTextView;
private FirebaseFirestore db = FirebaseFirestore.getInstance();
private CollectionReference noteRef = db.collection("inspiration");
private Toolbar toolbar;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//mQuoteTextView = (TextView) findViewById(R.id.text_view_data);
textViewData = (TextView) findViewById(R.id.text_view_data);
//Toolbar Options
//toolbar = (Toolbar) findViewById(R.id.testToolbar);
//setSupportActionBar(toolbar);
//getSupportActionBar().setTitle("HomePage");
//getSupportActionBar().setDisplayHomeAsUpEnabled(true);
//
}
public void saveQuote(View view){
EditText quoteView = (EditText) findViewById(R.id.editTextQuote);
EditText authorVIew = (EditText) findViewById(R.id.editTextAuthor);
String quoteText = quoteView.getText().toString();
String authorText = authorVIew.getText().toString();
if (quoteText.isEmpty() || authorText.isEmpty()){return;}
Map<String, Object> dataToSave = new HashMap<String, Object>();
dataToSave.put("QUOTE_KEY", quoteText);
dataToSave.put("AUTHOR_KEY", authorText);
mDocRef.set(dataToSave).addOnSuccessListener(new OnSuccessListener<Void>() {
@Override
public void onSuccess(Void aVoid) {
Log.d(TAG, "Document has been saved");
}
}).addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {
Log.w(TAG, "Document was not saved", e);
}
});
}
public void loadNote(View v){
mDocRef.get()
.addOnSuccessListener(new OnSuccessListener<DocumentSnapshot>() {
@Override
public void onSuccess(DocumentSnapshot documentSnapshot) {
if(documentSnapshot.exists()){
String title = documentSnapshot.getString(QUOTE_KEY);
String description = documentSnapshot.getString(AUTHOR_KEY);
//Map<String, Object> note = documentSnapshot.getData();
textViewData.setText("Title" + title + "n" + "Description: " + description);
}else{
Toast.makeText(MainActivity.this, "Document does not exits", Toast.LENGTH_SHORT);
}
}
})
.addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {
Toast.makeText(MainActivity.this, "ERROR", Toast.LENGTH_SHORT).show();
Log.d(TAG, e.toString());
}
});
}
}
android firebase google-cloud-firestore
android firebase google-cloud-firestore
edited Nov 19 '18 at 3:53
Frank van Puffelen
228k28374398
228k28374398
asked Nov 18 '18 at 22:01
TestikTestik
83
83
Not sure about this but try - String title = documentSnapshot.getString("QUOTE_KEY"); and same for the Author_key... probably need to declare a string.
– Nero
Nov 18 '18 at 22:06
What do you exactly mean ? I did this in the loadNote methode.
– Testik
Nov 19 '18 at 7:34
Now i understood you.THANK YOU it works now !!
– Testik
Nov 19 '18 at 8:54
I've added the answer, can you please accept it to take it off the unanswered question list.
– Nero
Nov 21 '18 at 20:11
add a comment |
Not sure about this but try - String title = documentSnapshot.getString("QUOTE_KEY"); and same for the Author_key... probably need to declare a string.
– Nero
Nov 18 '18 at 22:06
What do you exactly mean ? I did this in the loadNote methode.
– Testik
Nov 19 '18 at 7:34
Now i understood you.THANK YOU it works now !!
– Testik
Nov 19 '18 at 8:54
I've added the answer, can you please accept it to take it off the unanswered question list.
– Nero
Nov 21 '18 at 20:11
Not sure about this but try - String title = documentSnapshot.getString("QUOTE_KEY"); and same for the Author_key... probably need to declare a string.
– Nero
Nov 18 '18 at 22:06
Not sure about this but try - String title = documentSnapshot.getString("QUOTE_KEY"); and same for the Author_key... probably need to declare a string.
– Nero
Nov 18 '18 at 22:06
What do you exactly mean ? I did this in the loadNote methode.
– Testik
Nov 19 '18 at 7:34
What do you exactly mean ? I did this in the loadNote methode.
– Testik
Nov 19 '18 at 7:34
Now i understood you.THANK YOU it works now !!
– Testik
Nov 19 '18 at 8:54
Now i understood you.THANK YOU it works now !!
– Testik
Nov 19 '18 at 8:54
I've added the answer, can you please accept it to take it off the unanswered question list.
– Nero
Nov 21 '18 at 20:11
I've added the answer, can you please accept it to take it off the unanswered question list.
– Nero
Nov 21 '18 at 20:11
add a comment |
1 Answer
1
active
oldest
votes
As per my comment
String title = documentSnapshot.getString("QUOTE_KEY");
String description = documentSnapshot.getString("AUTHOR_KEY");
In your code, when you are adding the values, you are declaring a string value. However, when you are retrieving the values, you have declared string variable with different value. Therefore, it can't find what you are looking for.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53365901%2fdont-get-data-from-firestore-on-my-textview%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
As per my comment
String title = documentSnapshot.getString("QUOTE_KEY");
String description = documentSnapshot.getString("AUTHOR_KEY");
In your code, when you are adding the values, you are declaring a string value. However, when you are retrieving the values, you have declared string variable with different value. Therefore, it can't find what you are looking for.
add a comment |
As per my comment
String title = documentSnapshot.getString("QUOTE_KEY");
String description = documentSnapshot.getString("AUTHOR_KEY");
In your code, when you are adding the values, you are declaring a string value. However, when you are retrieving the values, you have declared string variable with different value. Therefore, it can't find what you are looking for.
add a comment |
As per my comment
String title = documentSnapshot.getString("QUOTE_KEY");
String description = documentSnapshot.getString("AUTHOR_KEY");
In your code, when you are adding the values, you are declaring a string value. However, when you are retrieving the values, you have declared string variable with different value. Therefore, it can't find what you are looking for.
As per my comment
String title = documentSnapshot.getString("QUOTE_KEY");
String description = documentSnapshot.getString("AUTHOR_KEY");
In your code, when you are adding the values, you are declaring a string value. However, when you are retrieving the values, you have declared string variable with different value. Therefore, it can't find what you are looking for.
edited Nov 19 '18 at 21:08
answered Nov 19 '18 at 14:20
NeroNero
6931319
6931319
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53365901%2fdont-get-data-from-firestore-on-my-textview%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Not sure about this but try - String title = documentSnapshot.getString("QUOTE_KEY"); and same for the Author_key... probably need to declare a string.
– Nero
Nov 18 '18 at 22:06
What do you exactly mean ? I did this in the loadNote methode.
– Testik
Nov 19 '18 at 7:34
Now i understood you.THANK YOU it works now !!
– Testik
Nov 19 '18 at 8:54
I've added the answer, can you please accept it to take it off the unanswered question list.
– Nero
Nov 21 '18 at 20:11