Hi all, i would like to know if it is possible to ...
# getting-started
k
Hi all, i would like to know if it is possible to show/hide UI element over a two separated activity? in example, i had to 2 activities, first is the main activity(home) and second is the support activity(something like information or pop up). from this examples i want to somehow show the support activity overlaying the main activity, so far i able to do this by doing
include
of the support activity layout on the main activity file. the next thing i want to do, is that i want to be able to interact with the support activity, which is the basic interaction was only a show/hide elements. i was thinking that i should be able to do this by using
visibility = View.GONE
or
visibility = View.VISIBLE
on the textview element, but no matter what i do, everytime i click on the textview, it results in the app crashing. i'm quite stuck on this part, do anyone have any idea or insight on where do i wrong? or what should i do? thank you!
a
Activities are meant only show 1 at a time so fundamentally this is impossible. Fragments solve this problem and in this particular case it sounds like it should just be a dialogfragment which is not much different but gives the popup effect you want.
👍 1
k
Ok, somehow i got what you mean. so the process was like: main activities ->
include
the second activities as dialog fragment -> add
view.gone
or
view.visible
on the second activities. does the dialogfragment usually will prevent this kind of app crash due to multiple activities overlaying on each other? also i kind of forgot about it because of the name, but it's not completely popup effect, the second activity will show up in a custom ShowCaseView like manner.
thank you for the suggestion, i have figured on how to do the show/hide element.