notes-android icon indicating copy to clipboard operation
notes-android copied to clipboard

allow EditNoteActivity to open main application when called from widget

Open newhinton opened this issue 3 years ago • 5 comments

This fixes #1412

When we close() the activity, currently we only call finish() after cleanup. This results in the currently visible activity to be removed. However, if this activity is actually the current root of the application, it ends the application altogether.

This is often the case when the app was called from a widget, and hasn't been used for a while. Android cleans note's backstack, and then the EditNoteAcitivity-Instance is actually the root instance. Instead of finishing this, we redirect the app to the MainActivity which is the desired target.

newhinton avatar Jun 25 '22 10:06 newhinton

I think it was a requirement at some point in the past (by @jancborchardt ?) that the app should explicitly not show the note list when closing the editor after launching it from a widget. I unfortunately wasn't able to find the related discussion yet ...

stefan-niedermann avatar Jun 27 '22 08:06 stefan-niedermann

Hm yes, i checked my calendar-app and the widget there does the same thing. However, does it make sense?

I can only speak for myself, but if i open a note, it is very likely that i want to edit a different note aswell, especially when i use the back button on the top.

If i want to exit, i would usually use the home button/gesture to exit it completely.

How do we find out what people want?

As a contra-point: K9-Mail opens the mail from the widget, and if the user goes 'back', it opens the main view aswell.

newhinton avatar Jun 27 '22 09:06 newhinton

Totally agree actually. I have the same problem with the single note widget.

I edit something in single note, want to go to the notes list to edit some other note, using the top left "back" button, but then the app closes instead.

I'd be all for always opening the notes list when pressing the top left back button. :)

jancborchardt avatar Jun 27 '22 10:06 jancborchardt

@jancborchardt Does this also apply to the same issue in the deck-app? It may be a different use case, so maybe it is different there. (https://github.com/stefan-niedermann/nextcloud-deck/issues/1293)

newhinton avatar Jun 27 '22 10:06 newhinton

@newhinton I'd say yep let's do the same there. Then it's consistent: Whenever you are in a card and press top left (in-app) back button, you also stay in the app.

jancborchardt avatar Jun 27 '22 11:06 jancborchardt

Any news on this? I can fix this in the deck app aswell on the weekend if you want.

newhinton avatar Aug 11 '22 10:08 newhinton

Sure, let's bring this in. Would you mind rebasing the branch? Then I'll merge it 🙂

stefan-niedermann avatar Aug 11 '22 11:08 stefan-niedermann

Done! The automatic merge was possible.

newhinton avatar Aug 11 '22 17:08 newhinton