I'm trying to call a function to open a browser with a given url but get this error message.
I looked at those two question and understand I probably have a context problem but still couldn't quite understand how to resolve it.
Cannot resolve method startActivity()
Cannot find symbol method startActivity(android.content.Intent)
My code:
public void openWeb(String url) {
String fullUrl = "http://bit.do/"+url;
Uri webpage = Uri.parse(fullUrl);
Intent intent = new Intent(Intent.ACTION_VIEW, webpage);
if (intent.resolveActivity(getPackageManager()) != null) {
startActivity(intent);
}
}