I would like to know how I can create a “dynamic intent” in android.
In the end, I want to show a list of data items that are cut from the web service, and when the item is clicked, to start a new action with some set parameters. Please note that all elements will be an instance of the same class, which, I believe, will expand Activiy.
I managed to list the elements, but cannot find a way to make part of the "dynamic intention".
I know that the following code does not work, but it illustrates what I'm trying to execute.
I hope I understand what I understand.
if (((TextView) view).getText().equals("Page")) { MyClass item = new MyClass("foo", "bar"); myIntent = new Intent(view.getContext(), item); }
Thanks.
nunos source share