I just wanna link what the user types in the ACTV, to the name in my Realtime Database, so that i can load the value of that name using Glide, and display the downloadurl value in my app after clicking my button. But right now, nothing is being displayed.  public class Translate extends AppCompatActivity {      private static final String TAG = "Translate";       DatabaseReference rootRef = FirebaseDatabase.getInstance().getReference();     DatabaseReference firebaseDatabase = rootRef.child("main");      @Override     protected void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         setContentView(R.layout.activity_translate);          final Button button  = (Button)findViewById(R.id.button3);         final ImageView imageView = findViewById(R.id.imageView1);         final AutoCompleteTextView textView = (AutoCompleteTextView) findViewById(R.id.autoCompleteTextView);          String[] suggest = getResources().getStringArray(R.array.array);         ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;&gt;(this, R.layout.support_simple_spinner_dropdown_item, suggest);         textView.setAdapter(adapter);           firebaseDatabase.addValueEventListener(new ValueEventListener() {             @Override             public void onDataChange(@NonNull final DataSnapshot dataSnapshot) {                 for (DataSnapshot childSnapshot: dataSnapshot.getChildren()) {                     final String source = textView.getText().toString();                     final String message = childSnapshot.getKey();                               button.setOnClickListener(new View.OnClickListener() {                                 @Override                                 public void onClick(View v) {                                     if(source==message){                                         GlideApp.with(Translate.this).load(firebaseDatabase.child(message)).placeholder(R.drawable.ic_launcher_background).into(imageView);                                     }                                   }                             });                          }                       }                       @Override                     public void onCancelled(@NonNull DatabaseError databaseError) {                         Log.d(TAG, databaseError.getMessage());                     }                 });              }          }   My database is as below :-   I'm trying to link match what the user types in to the database using the if statement if(source==message), but i think that is the wrong way.  Any help is appreciated thank you.
I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug.  Is == bad? When should it and should it not be used? What's the difference?
If we fail to reject the null hypothesis in a large study, isn't it evidence for the null? How to pass a list of columns to data.table where some are predetermined How to prove this inequality $ x + \frac{1}{x} \geq 2 $ $\mathbb R = X^2$ as a Cartesian product I wonder if it is possible to consider $\mathbb R$ as a Cartesian product $X\times X$ for some set $X$. From the point of view of the dimensionality, there are spaces with a Hausdorff dimension $1/2$ (sort of Cantor sets), but I guess there are other problems in this construction  unrelated to the dimension.  Edited: replying on the comment by Asaf. I want that for all $r\in\mathbb R$ there exists a unique representation $r=\langle x,y\rangle$ where $x\in X$ and $y\in X$. Also, what if we want to have $X$ to be a topological space and $h:X\times X\to\mathbb R$ to be a homeomorphism? How to avoiding losing your current browsers websites when being redirected by wireless login pages How do you combine two jQuery search results? eg:  var $allFoos = $('.foo'),     $allBars = $('.bar')     $allFoosAndBars = $allFoos + $allBars;   Obviously, I just made up that last line, but I hope it makes it sorta clear what I mean. To be clear, the example is greatly simplified, and it could be any arbitrary sets i'm talking about, so $('.foo, .bar') is not what I'm after. Operators can be cyclically interchanged inside a trace: $${\rm Tr} (AB)~=~{\rm Tr} (BA).$$ This means the trace of a commutator of any two operators is zero: $${\rm Tr} ([A,B])~=~0.$$ But what about the commutator of the position and momentum operators for a quantum particle? On the one hand: $${\rm Tr}([x,p])~=~0,$$ while on the other hand: $$[x,p]~=~i\hbar.$$ How does this work out? This may be a very basic question.      Let $R$ be a commutative ring with unity (may be assumed to be an integral domain, if necessary) and $I$ be an ideal of $R$. Assume that $R/I$ is isomorphic to $R$. Does this mean $I=(0)$ ? Here is the problem:  Suppose that $*$ is an associative binary operation on a set $S$. Let  $$H:= \{a \in  S\mid a * x = x * a \mbox{ for all }x\in S\}.$$  In other words, $H$ is consisting of all the elements of $S$ that commute with every element in $S$.  Show that $H$ is closed under $*$. Finding integer solutions for $6x+15y+20z=1$ Problem: Find integers $x$, $y$, and $z$ that satisfy the equation $6x+15y+20z=1$.  I noticed that $\gcd(6,15)=3$, $\gcd(15,20)=5$, and that $\gcd(6,20)=2$. And of course $\gcd(6,15,2)=1$.   Of course I know to set one of the variables (x, y, or z) to be zero. But I want to know how to get the more trivial answers. But where do I go from here to find the solutions? Does there exist a matrix $\mathbf{A}\in\mathbb{R}^{3\times3}$ such that $\mathbf{A}^{2}=-\mathbf{I}$? View revision history on mobile site It looks like it's currently not possible to view the revision history of a post from the mobile site. I think it would be a lot simpler than loading the desktop site on a phone just to get the revision history. Is every solution of Einstein field equations unique? Einstein's equation is  $$8 \pi T_{ab} = G_{ab},$$  where the left side contains the stress-energy tensor and the right side contains the Einstein tensor.  Is there exactly one unique stress-energy tensor corresponding to a given spacetime curvature? Or is it possible for one curvature (i.e. one spacetime metric) to be produced by multiple different mass configurations? The shortcode produced by this function - a list of all sites in a multisite - outputs above the content in the loop, no matter where it is placed in the editor.  I've looked at the other related questions and answers on WPSE and realize that it has to do with the function using echo instead of return, but it's not as easy as replacing the instances of echo with return in the function below. Or adding echo=0 with a WP function like wp_list_pages()  Any ideas? Where is the function that needs to be returned instead of echoed?  // Output a single menu item function projects_menu_entry($id, $title, $link_self) {     global $blog_id;     if ($link_self || $id != $blog_id) {         echo '&lt;li&gt;';         if ($id == $blog_id) {             echo '&lt;strong&gt;';         }         $url = get_home_url($id);         if (substr($url, -1) != '/') {             // Note: I added a "/" to the end of the URL because WordPress             // wasn't doing that automatically in v3.0.4             $url .= '/';         }         echo '&lt;a href="' . $url . '"&gt;' . $title . '&lt;/a&gt;';         if ($id == $blog_id) {             echo '&lt;/strong&gt;';         }         echo '&lt;/li&gt;';     } }  // Output the whole menu // If $link_self is false, skip the current site - used to display the menu on the homepage function projects_menu($link_self = true) {     global $wpdb;      echo '&lt;ul&gt;';      projects_menu_entry(1, 'Home', $link_self);      $blogs = $wpdb-&gt;get_results("         SELECT blog_id         FROM {$wpdb-&gt;blogs}         WHERE site_id = '{$wpdb-&gt;siteid}'         AND spam = '0'         AND deleted = '0'         AND archived = '0'         AND blog_id != 1     ");      $sites = array();     foreach ($blogs as $blog) {         $sites[$blog-&gt;blog_id] = get_blog_option($blog-&gt;blog_id, 'blogname');     }      natsort($sites);     foreach ($sites as $blog_id =&gt; $blog_title) {         projects_menu_entry($blog_id, $blog_title, $link_self);     }     echo '&lt;/ul&gt;'; }  // Adds a [bloglist] shortcode  function bloglist_shortcode($atts) {     projects_menu(false); }  add_shortcode('bloglist', 'bloglist_shortcode'); USB flash drive not working or is appearing as an empty disk drive, Disk Management reports "No Media" with 0 bytes size Why has my Samsung Galaxy S2 become a data hog? A required field that isn't really required? ...the email field in my clients data entry system is required but users of the system are allowed to enter na@na.com if the customer refuses or doesn't have an email address. Is this best practice? Have any suggestions or workarounds for their solution? how to left justify comments to indent same as other text in Algorithmic How do I left justify my comments in the algorithm.  I am using algorithmicx package.  What I want is: to pull the comment to left as shown in the attached snapshot.  The code for my algorithm is       \documentclass[a4paper]{article}     \pagestyle{empty}     \usepackage{algorithm}     \usepackage{algpseudocode}     \usepackage[caption=false,font=footnotesize]{subfig}     \begin{document}     \begin{algorithm} \label{algoQ}     \caption{Algorithm to check quality of methods}     \begin{algorithmic}     \For{\textbf{each} $msd$ in$msdList$}  \Comment { \% for each MSD \%}     \Statex   \Comment { \% get MSDs referenced method service \%}     \EndFor \textbf{endFor}     \end{algorithmic}     \end{algorithm}     \end{document} If I design a PC for use as an NPC, how much XP should he give when killed? As part of an early quest, my PCs are likely to face off against a wizard.  The problem here is that the stat block for Mage NPCs listed in the Basic Rules has a Challenge Rating of 6, while the PCs are going to be five Level 1s. So, instead of messing with the stat block and risk weakening it too much/too little, I'm choosing to create a Level 1 Wizard PC and use it as an NPC for this quest.  The problem with that is that, as far as I can tell, there aren't any designated rules for assigning either Challenge Ratings or XP values to a PC. So, should I just give the wizard a Challenge Rating equal to his level (and thus have him give 200 xp when killed), or is there a better way to do this?  (This is different from , because he's asking for a way to assign a level to an NPC, while I'm asking for a way to assign an XP value/Challenge Rating to a PC (for use as an NPC). Similar questions, but different.) I've got a circuit in the basement carrying a handful of outlets.  This circuit has no ground wire.  I want to add a couple of outlets and want them to be grounded.  I may even want gfci outlets on them in the future.  I have no reasonable way of getting a ground wire to the panel but I do have easy access to another circuit that does have a ground wire.  Is it acceptable to borrow or share a ground wire between circuits?  If not, why not?  Both circuits are 20A with 12 AWG wire.