title: Call a local variable in doInbackground
body: <p>i m using an asynctask but i  can't handle local variables in doInBackground method so in my case when i want to set the local variable test i got an error 
  so what can i do ? 
  and when i set test with this way test="testme" without this i didn't got an error but test is always null.
  so what can i do to set a local variable in doinbackground method </p>
  
  <pre><code>public class ConnectTask extends AsyncTask{
      Context context;
      User user2 ;
      String test;
      private User authentifcatedUser;
  
      public ConnectTask(User authentifcatedUser) {
          this.authentifcatedUser = authentifcatedUser;
  
      }
  
      public User getAuthentifcatedUser() {
          return authentifcatedUser;
      }
  
      public void setAuthentifcatedUser(User authentifcatedUser) {
          this.authentifcatedUser = authentifcatedUser;
      }
  
  
  
      public String getTest() {
          return test;
      }
  
      public  User getUser(){
          return  this.user2;
      }
  
      public void setTest(String test) {
          this.test = test;
      }
  
      @Override
      protected Object doInBackground(Object[] params) {
  
          connect();
  
          return test;
      }
  
      public String connect(){
  
  
          final Firebase ref = new Firebase("https://app.firebaseio.com/users");
                  Query query = ref.orderByChild("username").equalTo("testme");
                  query.addListenerForSingleValueEvent(new ValueEventListener() {
  
                      @Override
                      public void onDataChange(DataSnapshot dataSnapshot) {
                          for (DataSnapshot userSnapshot : dataSnapshot.getChildren()) {
                            User  user = userSnapshot.getValue(User.class);
  
                             System.out.println("my birth day is "+user.getDateOfBirth());
  
                            user2=new User(user.getUsername(),user.getEmail(),user.getPassword(),user.getSignUpDate(),user.dateOfBirth);
                              System.out.println("my email is" + user2.getEmail());
                              test="aaaaaaaaa";
  
  
                          }
  
                         /* User user = dataSnapshot.getValue(User.class);
                          Log.w( "tag", dataSnapshot.toString());*/
  
                      }
  
                      @Override
                      public void onCancelled(FirebaseError firebaseError) {
  
                      }
  
                  });
  
  
          return test;
  
  
      }
  
      @Override
      protected void onPostExecute(Object o) {
          super.onPostExecute(o);
  
          System.out.println("retuuuurn"+connect())   ;
  
      }
  }
  </code></pre>