I finished the code for my app months ago and everything worked great.

In the previous weeks I've updated some libraries and done some tweaks here and there but I haven't touch the specific class where the problem appeared.

When the user presses a button, he should be able to chose a file.

Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.setType("*/*");
startActivityForResult(intent, 1);

Then on that same class I have this

@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if (data != null) {
        if (requestCode == 1) {
            if (resultCode == Activity.RESULT_OK) {
                selectedFile = data.getData();

But the window to chose a file never shows up, I just see a quick flash and nothing happens, so data is always null

This is the error I see on Logcat:

04-29 12:45:28.072 26104-26104/com.android.documentsui D/AndroidRuntime: Shutting down VM 04-29 12:45:28.072 26104-26104/com.android.documentsui E/AndroidRuntime: FATAL EXCEPTION: main Process: com.android.documentsui, PID: 26104 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.documentsui/com.android.documentsui.DocumentsActivity}: java.lang.RuntimeException: A TaskDescription's primary color should be opaque at android.app.ActivityThread.performLaunchActivity(ActivityThread.java) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java) at android.app.ActivityThread.access$800(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java) at android.os.Handler.dispatchMessage(Handler.java) at android.os.Looper.loop(Looper.java) at android.app.ActivityThread.main(ActivityThread.java) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java) Caused by: java.lang.RuntimeException: A TaskDescription's primary color should be opaque at android.app.ActivityManager$TaskDescription.(ActivityManager.java) at android.app.Activity.onApplyThemeResource(Activity.java) at android.view.ContextThemeWrapper.initializeTheme(ContextThemeWrapper.java) at android.view.ContextThemeWrapper.setTheme(ContextThemeWrapper.java) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java)  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java)  at android.app.ActivityThread.access$800(ActivityThread.java)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java)  at android.os.Handler.dispatchMessage(Handler.java)  at android.os.Looper.loop(Looper.java)  at android.app.ActivityThread.main(ActivityThread.java)  at java.lang.reflect.Method.invoke(Native Method)  at java.lang.reflect.Method.invoke(Method.java:372)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java) 

I've looked on colors.xml and style.xml and there isn't any color with 8 characters to give transparency. The size of all colors is 6 hex characters.

I really don't understand what changed for this to sudenly stop working.

0 Answers