i have fragment
public class twitterfragment extends fragment implements onclicklistener {} from fragment invoking intent as:
intent intent = new intent(this, webviewactivity.class); where,
public class webviewactivity extends activity { but invoking intent giving error:
error:(214, 33) error: no suitable constructor found intent(twitterfragment,class<webviewactivity>) constructor intent.intent(string,uri) not applicable (argument mismatch; twitterfragment cannot converted string) constructor intent.intent(context,class<?>) not applicable (argument mismatch; twitterfragment cannot converted context) this code working when twitterfragment class extends activity instead of fragment.
fragment not context. try this:
intent intent = new intent(getactivity(), webviewactivity.class);
Comments
Post a Comment