New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loop crashes when certain intents can't be handled #354

Open
tianxiaogu opened this Issue Nov 3, 2017 · 1 comment

Comments

Projects
None yet
2 participants
@tianxiaogu

tianxiaogu commented Nov 3, 2017

We may need to check whether the device can handle the intent before requesting the activity.

// CRASH: org.isoron.uhabits (pid 21803) (elapsed nanos: 22588903455589)
// Short Msg: android.content.ActivityNotFoundException
// Long Msg: android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.SEND typ=application/zip flg=0x1 clip={application/zip U:c      ontent://org.isoron.uhabits/external-files/CSV/Loop%20Habits%20CSV%202017-11-02.zip} (has extras) }
// Build Label: Android/sdk_google_phone_x86/generic_x86:6.0/MASTER/4088240:userdebug/test-keys
// Build Changelist: 4088240
// Build Time: 1497047463000
// android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.SEND typ=application/zip flg=0x1 clip={application/zip U:content://o      rg.isoron.uhabits/external-files/CSV/Loop%20Habits%20CSV%202017-11-02.zip} (has extras) }
//    at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1798)
//    at android.app.Instrumentation.execStartActivity(Instrumentation.java:1512)
//    at android.app.Activity.startActivityForResult(Activity.java:3917)
//    at android.support.v4.app.BaseFragmentActivityJB.startActivityForResult(BaseFragmentActivityJB.java:50)
//    at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:79)
//    at android.app.Activity.startActivityForResult(Activity.java:3877)
//    at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:859)
//    at android.app.Activity.startActivity(Activity.java:4200)
//    at android.app.Activity.startActivity(Activity.java:4168)
//    at org.isoron.uhabits.activities.BaseScreen.showSendFileScreen(BaseScreen.java:244)
//    at org.isoron.uhabits.activities.habits.show.ShowHabitsMenu.lambda$exportHabit$0(ShowHabitsMenu.java:68)
//    at org.isoron.uhabits.activities.habits.show.ShowHabitsMenu.access$lambda$0(ShowHabitsMenu.java)
//    at org.isoron.uhabits.activities.habits.show.ShowHabitsMenu$$Lambda$1.onExportCSVFinished(Unknown Source)
//    at org.isoron.uhabits.tasks.ExportCSVTask.onPostExecute(ExportCSVTask.java:85)
//    at org.isoron.uhabits.tasks.AndroidTaskRunner$CustomAsyncTask.onPostExecute(AndroidTaskRunner.java:115)
//    at org.isoron.uhabits.tasks.AndroidTaskRunner$CustomAsyncTask.onPostExecute(AndroidTaskRunner.java:86)
//    at android.os.AsyncTask.finish(AsyncTask.java:651)
//    at android.os.AsyncTask.-wrap1(AsyncTask.java)
//    at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:668)
//    at android.os.Handler.dispatchMessage(Handler.java:102)
//    at android.os.Looper.loop(Looper.java:148)
//    at android.app.ActivityThread.main(ActivityThread.java:5417)
//    at java.lang.reflect.Method.invoke(Native Method)
//    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
//    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
// 

@iSoron iSoron added the minor-bug label Apr 21, 2018

@iSoron iSoron changed the title from android.content.ActivityNotFoundException to Loop crashes when certain intents can't be handled Apr 21, 2018

@iSoron

This comment has been minimized.

Owner

iSoron commented Apr 21, 2018

As far as I know, any real device would have at least one app that is able to handle the intents we request -- this only appears to be an issue on the emulator. In any case, this is a bug. Thank you for reporting it.

@iSoron iSoron closed this Apr 21, 2018

@iSoron iSoron reopened this Apr 21, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment