Hello Guys,
i am facing errors in my code
@SimpleFunction(description = "")
public void SendMail(String to, String subject, String mailText){
String a = "mailto:";
String b = "?subject=";
String c = "&body=";
String url = a+to+b+subject+c+mailText;
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(url));
startActivity(intent);
}
ERROR LOG :-
[javac] D:\vedang\extension-template-master\src\com\extensions\randomimg\RandomImg.java:42: error: cannot find symbol
[javac] startActivity(intent);
[javac] ^
Do you need a code for this?
1 Like
wait that was my deleted topic.
now see. i am facing a error @Salman_Dev
Maybe this code can help you :
startActivity(new Intent(Intent.ACTION_VIEW, [Uri.parse](http://Uri.parse)("https://site.ru")));
If my code is successful, please let me know
Techno_Vedang:
Hello Guys,
i am facing errors in my code
@SimpleFunction(description = "")
public void SendMail(String to, String subject, String mailText){
String a = "mailto:";
String b = "?subject=";
String c = "&body=";
String url = a+to+b+subject+c+mailText;
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(url));
startActivity(intent);
}
I think I know the problem in the code.
wait a minute I will fix the code for
You don't have an intent name
Try the code that I fixed:
@SimpleFunction(description = "")
public void SendMail(String to, String subject, String mailText){
String a = "mailto:";
String b = "?subject=";
String c = "&body=";
String url = a+to+b+subject+c+mailText;
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
startActivity(i);
}
Salman_Dev:
@SimpleFunction(description = "")
public void SendMail(String to, String subject, String mailText){
String a = "mailto:";
String b = "?subject=";
String c = "&body=";
String url = a+to+b+subject+c+mailText;
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
startActivity(i);
}
lol what is the difference between your code and my code
Salman_Dev:
only slightly differen
you just changed name of Intent
still same error
[javac] D:\vedang\extension-template-master\src\com\extensions\randomimg\RandomImg.java:44: error: cannot find symbol
[javac] startActivity(i);
Try this new code :
@SimpleFunction(description = "")
public void SendMail(String to, String subject, String mailText){
String a = "mailto:";
String b = "?subject=";
String c = "&body=";
String url = a+b+c;
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
startActivity(i);
}
Salman_Dev:
new code
its old tried but same errors
I will try to find the code for you
1 Like