title: Dropbox show file list
body: <p>I encounter a problem when show dropbox filelist. When i succeed authentication from dropbox and get an access token
  i set access token <code>mDBApi.getSession().setAccessTokenPair(tokens);</code> 
  and then it will stop at <code>Entry contact = mDBApi.metadata("/", 1000, null, true, null);</code> i survey o lot of solution about show file list on dorpbox, i can't find out the difference from my code. please help me :(</p>
  
  <pre><code>public class DropBoxActivity extends Activity{
  final static private String APP_KEY = "MyKey";
  final static private String APP_SECRET = "MySecret";
  final static private AccessType ACCESS_TYPE = AccessType.DROPBOX;
  // In the class declaration section:
  private DropboxAPI&lt;AndroidAuthSession&gt; mDBApi;
  SharedPreferences sharedPref;
  
  
  @Override
  protected void onCreate(Bundle savedInstanceState){
      super.onCreate(savedInstanceState);        
  
      setContentView(R.layout.activity_drop_box); 
      sharedPref = PreferenceManager.getDefaultSharedPreferences(this);
  
      // And later in some initialization function:
      AppKeyPair appKeys = new AppKeyPair(APP_KEY, APP_SECRET);
      AndroidAuthSession session = new AndroidAuthSession(appKeys, ACCESS_TYPE);
      mDBApi = new DropboxAPI&lt;AndroidAuthSession&gt;(session);
      mDBApi.getSession().startAuthentication(this);
      Log.d("DbAuthLog", "OnCreateEnd");
  
  }
  
  
  @Override
  protected void onResume(){
      super.onResume();
      AccessTokenPair tokens=null;  
      //return control
       if (mDBApi != null &amp;&amp; mDBApi.getSession().authenticationSuccessful()) {
           try{
                 //MANDATORY call to complete auth.
                 //Sets the access token on the session
               mDBApi.getSession().finishAuthentication();
  
               tokens = mDBApi.getSession().getAccessTokenPair();              
  
               // Provide your own storeKeys to persist the access token pair
               // A typical way to store tokens is using SharedPreferences
               storeKeys(tokens.key, tokens.secret);
  
  
           }catch(IllegalStateException e){
  
               Log.i("DbAuthLog", "Error authenticating", e);
           } 
  
       }
  
       try {           
  
          Log.d("DbAuthLog", "step0");
          AccessTokenPair access = getStoredKeys();
          mDBApi.getSession().setAccessTokenPair(tokens);
          Entry contact = mDBApi.metadata("/", 1000, null, true, null);
          Log.d("DbAuthLog", "step1");
          List&lt;Entry&gt; CFolder = contact.contents;
          Log.d("DbAuthLog", "step2");
            for (Entry entry : CFolder) {
                  Log.i("DbAuthLog", "Filename: " + entry.fileName());
            }
            Log.d("DbAuthLog", "OnResumeEnd");
  
      } catch(DropboxServerException e){
          Log.d("DbAuthLog", "DropboxServerException");
          e.printStackTrace();
      } catch(DropboxUnlinkedException e){
          Log.d("DbAuthLog", "DropboxUnlinkedException");
          e.printStackTrace();
      } catch (DropboxIOException e) {
          // TODO Auto-generated catch block
          Log.d("DbAuthLog", "DropboxIOException");
          e.printStackTrace();
      } catch (DropboxException e) {
          // TODO Auto-generated catch block
          Log.d("DbAuthLog", "DropboxException");
          e.printStackTrace();
      } catch (NullPointerException e){
          Log.d("DbAuthLog", "DropboxException");
      }
  
  }
  
  private void storeKeys(String key, String secret){
  
      Log.d("DbAuthLog", "storeKeys");
      sharedPref = this.getPreferences(Context.MODE_PRIVATE);
      SharedPreferences.Editor editor = sharedPref.edit();
      editor.putString("key", key);
      editor.putString("secret", secret);
      editor.commit();
      Log.d("DbAuthLog", key);
      Log.d("DbAuthLog", secret);
  
  
  }
  </code></pre>