Bläddra i källkod

Replaced public scope with protected scope in inherited on*** methods for FileActivityS

David A. Velasco 12 år sedan
förälder
incheckning
979bdc83b2

+ 9 - 12
src/com/owncloud/android/ui/activity/FileActivity.java

@@ -23,7 +23,6 @@ import android.accounts.AccountManager;
 import android.accounts.AccountManagerCallback;
 import android.accounts.AccountManagerFuture;
 import android.accounts.OperationCanceledException;
-import android.content.Intent;
 import android.os.Bundle;
 
 import com.actionbarsherlock.app.SherlockFragmentActivity;
@@ -56,7 +55,7 @@ public abstract class FileActivity extends SherlockFragmentActivity {
 
     
     @Override
-    public void onCreate(Bundle savedInstanceState) {
+    protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         
         /// Load of saved instance state: keep this always before initDataFromCurrentAccount()
@@ -74,8 +73,12 @@ public abstract class FileActivity extends SherlockFragmentActivity {
     }
 
     
+    /**
+     * Validate the ownCloud {@link Account} associated to the Activity any time it is 
+     * started, and if not valid tries to move to a different Account.
+     */
     @Override
-    public void onStart() {
+    protected void onStart() {
         Log_OC.e(TAG, "onStart en FileActivity");
         super.onStart();
         /// Validate account, and try to fix if wrong
@@ -98,15 +101,6 @@ public abstract class FileActivity extends SherlockFragmentActivity {
     /**
      * Launches the account creation activity. To use when no ownCloud account is available
      */
-    private void createFirstAccountOldStyle() {
-        Intent intent = new Intent(android.provider.Settings.ACTION_ADD_ACCOUNT);
-        intent.putExtra(android.provider.Settings.EXTRA_AUTHORITIES, new String[] { AccountAuthenticator.AUTHORITY });
-        startActivity(intent); 
-        
-        finish();
-    }
-
-    
     private void createFirstAccount() {
         AccountManager am = AccountManager.get(getApplicationContext());
         am.addAccount(AccountAuthenticator.ACCOUNT_TYPE, 
@@ -119,6 +113,9 @@ public abstract class FileActivity extends SherlockFragmentActivity {
     }
 
     
+    /**
+     * {@inheritDoc}
+     */
     @Override
     protected void onSaveInstanceState(Bundle outState) {
         super.onSaveInstanceState(outState);

+ 6 - 0
src/com/owncloud/android/ui/activity/FileDetailActivity.java

@@ -467,4 +467,10 @@ public class FileDetailActivity extends SherlockFragmentActivity implements File
         
     }
 
+    @Override
+    protected void onAccountChanged() {
+        // TODO Auto-generated method stub
+        
+    }
+
 }

+ 5 - 5
src/com/owncloud/android/ui/activity/FileDisplayActivity.java

@@ -135,7 +135,7 @@ public class FileDisplayActivity extends FileActivity implements
     private boolean mStarted;
 
     @Override
-    public void onCreate(Bundle savedInstanceState) {
+    protected void onCreate(Bundle savedInstanceState) {
         Log_OC.d(TAG, "onCreate() start");
         super.onCreate(savedInstanceState);
         
@@ -239,7 +239,7 @@ public class FileDisplayActivity extends FileActivity implements
     
     
     @Override
-    public void onStart() {
+    protected void onStart() {
         super.onStart();
         if (mNewConfigurationChangeToApplyOnStart != null) {
             checkConfigurationChange(mNewConfigurationChangeToApplyOnStart);
@@ -249,7 +249,7 @@ public class FileDisplayActivity extends FileActivity implements
     }
     
     @Override
-    public void onStop() {
+    protected void onStop() {
         super.onStop();
         mStarted = false;
     }
@@ -278,7 +278,7 @@ public class FileDisplayActivity extends FileActivity implements
 
 
     @Override
-    public void onDestroy() {
+    protected void onDestroy() {
         super.onDestroy();
         if (mDownloadConnection != null)
             unbindService(mDownloadConnection);
@@ -356,7 +356,7 @@ public class FileDisplayActivity extends FileActivity implements
     /**
      * Called, when the user selected something for uploading
      */
-    public void onActivityResult(int requestCode, int resultCode, Intent data) {
+    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
         super.onActivityResult(requestCode, resultCode, data);
         
         if (requestCode == ACTION_SELECT_CONTENT_FROM_APPS && (resultCode == RESULT_OK || resultCode == UploadFilesActivity.RESULT_OK_AND_MOVE)) {