Solved
------

Completely reinstalling the app was apparently not enough. I restarted my phone once and the app is back to where it was before this happened.

Original post
-------------

I'm making this app that integrates with dropbox and I've recently run in to some problems.

For a couple of months it worked as it should have. It asked for permission to use the logged in dropbox account on the phone when the app was first installed and after that all dropbox related stuff was made in the background as it was supposed to.

Recently I made a small change in my code which made the app go completely haywire and it just keep reloading the "allow dropbox" screen and you could not interact with the app. So naturally I reverted the change to how it was before but the problems didn't go away.

The Problem
-----------

Whenever I start the app it goes directly to the "allow dropbox" screen and when I press allow or deny it closes the app and goes back to my homescreen.

I have commented out every line of code related to dropbox, completely removed and reinstalled the app on my phone, and done a lot of cleans and rebuilds and all that in Android Studio but the problem is still there.

So now when I start the app it goes to the "allow dropbox" screen but since all that code is commented out it just says that the app is not correctly set up and all I can do is close it again.

The manifest:

```
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.MANAGE_ACCOUNTS" />

<application
    android:allowBackup="true"
    android:icon="@mipmap/app_icon"
    android:label="@string/app_name"
    android:supportsRtl="true"
    android:theme="@style/AppTheme" >
    <activity
        android:name="com.korpasjaervii.timereporter.MainActivity" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
        <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />
    </activity>
    <activity
        android:name="com.korpasjaervii.timereporter.CompilationActivity"
        android:parentActivityName="com.korpasjaervii.timereporter.MainActivity" >
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value="com.korpasjaervii.timereporter.MainActivity"/>
    </activity>
    <activity
        android:name="com.korpasjaervii.timereporter.SettingsActivity"
        android:label="@string/title_activity_settings"
        android:parentActivityName="com.korpasjaervii.timereporter.MainActivity" >
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value="com.korpasjaervii.timereporter.MainActivity" />
    </activity>
    <!--<activity
        android:name="com.dropbox.client2.android.AuthActivity"
        android:launchMode="singleTask"
        android:configChanges="orientation|keyboard">
        <intent-filter>
            <data android:scheme="db-rt97pzc7umt2krp" />
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.BROWSABLE"/>
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>-->
    <receiver android:name=".AlarmReceiver"/>
</application>

```

MainActivity's onCreate:

```
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
}

```

This is obviously not the actual onCreate but I reduced it to this and the problem is still there.

I should also say that logcat doesn't even register that my app has been opened.