so I have previously used to create Activities as a "User control" when writing Android apps, but then I wanted to move over to "custom components" or "compound components" since I hoped that would give me a "self-containing unit"; a class that can be instanciated so that I can access my methods etc.
In short, something that could be used in the same way as a "User Control" in .NET, ie a class that defines UI components as well as has code to handle user input and other logic.
However, how do I add that Component to the current Activity using code, and dynamically show it as a floating popup?
Note that I do not want to add a Component design-time in an XML-file, but I want to create it "dynamically" (layout in XML of course, but not to add the Component to another layout)
Let's say I have a list with items, and when someone clicks on a list item, a new Component should be created and shown as a "floating popup" over the main activity.
If I would have done it using Activites, it would look something like this:
Intent i = new Intent(getApplicationContext(), MyActiviy.class);
startActivity(i);
which would have shown the Activity "on top" according the the layout. But in this case I have no object to interact with (myActivity.doSomeCode() for example), which is what I was hoping to have with a Component.
So, the question is: How do I create and add a custom Component, so that it is shown in the same manner as with a Activity and so that I have access to the instance (the object) of the class?
I hope Im not too fuzzy =)