Hi all i have a class name
public class WikipediaDataSource extends NetworkDataSource{.....}
which extend to NetworkDataSource. what im try to do is from this class i would like to call new activity…
Intent i = new Intent(context, Obj3DView.class);
startActivity(i);
i got error saying
the method of startActivity(intent) is undefined for the type WikipediaDataSource
i read a lot on this issue .. it happens because this class do not extend the activity clas.
i try to follow others solutions. but it does not work for my case.
Please help! 🙂
If this line works:
Then you already have access to a Context, just use:
Since
startActivity()is a method of the Context class.Often developers pass the Context in the constructor:
Now your code should work.