@mfaridi - friendly advice. If you want to get effective help from us, you will have to start explaining your questions/issues more clearly. Your question above just does not give us anything to work with at all.
Error 1 The best overloaded method match for 'tar.activWeb.Foo.Foo(string)' has some invalidarguments.
Error 2 Argument 1: cannot convert from 'tar.activWeb' to 'string.
I think a community lives from discussions and helping each other, but just saying "give me some code" "solve my problem" does not work.
Noone can guess what your problem is, what you have tried, where you did fail, whatever.
So some information, e.g.
1. What is the context, what do you want to do with your app. What are the conditions etc..
2. What exactly is the problem - maybe with some significant sourcecode or stacktrace
3. When does this problem occure.
4. What have you tried to solve it yourselfe (searching google, trying solutions from e.g. stackoverflow, xamarin documentation...)
Sorry mfaridi, unless you have a clear question, I cannot help you. I gave you all the pieces of the puzzle already. If you're still stuck, it's time to read up on C# and Android, follow some guides, look at some sample apps, and then make another attempt.
code javascriptinteface class Foo : Java.Lang.Object
{
public Foo (Context context)
{
this.context = context;
}
public Foo (IntPtr handle, JniHandleOwnership transfer)
: base (handle, transfer)
{
}
Context context;
[Export]
// to become consistent with Java/JS interop convention, the argument cannot be System.String.
public void Bar (Java.Lang.String message)
{
Console.WriteLine ("Foo.Bar invoked!");
Toast.MakeText (context, "This is a Toast from C#! " + message, ToastLength.Short).Show ();
}
}`
Posts
@mfaridi - friendly advice. If you want to get effective help from us, you will have to start explaining your questions/issues more clearly. Your question above just does not give us anything to work with at all.
plase help
"please help" is not what Chris ment by "starting explaing questions/issues more clearly"
The more detailed information you offer to the community, the more likely it is, that someone will provide usefull solution to your problem.
This is my problem
Only context ):
context == information
After further explain?
I must ask. What have you tried?
Error 1 The best overloaded method match for 'tar.activWeb.Foo.Foo(string)' has some invalidarguments.
Error 2 Argument 1: cannot convert from 'tar.activWeb' to 'string.
` webview.AddJavascriptInterface(new Foo(this), "MY_JS");
plase help
I think a community lives from discussions and helping each other, but just saying "give me some code" "solve my problem" does not work.
Noone can guess what your problem is, what you have tried, where you did fail, whatever.
So some information, e.g.
1. What is the context, what do you want to do with your app. What are the conditions etc..
2. What exactly is the problem - maybe with some significant sourcecode or stacktrace
3. When does this problem occure.
4. What have you tried to solve it yourselfe (searching google, trying solutions from e.g. stackoverflow, xamarin documentation...)
I want the html code of a web page to read
We tried it did not come to
3 working days
please help
Sorry friend, I think a language/understanding gap is in our way. We do not know what you are trying to ask.
Perhaps you can find someone to translate for you, or maybe even try using Google Translate?
yes google translate
convert upload7.ir/images/86523402523743076760.png
Ok, so it seems you are still trying to extract HTML from a WebView. In your other thread about this I provided this link that explains how to do that (you just need to convert to C#): http://stackoverflow.com/questions/8200945/how-to-get-html-content-from-a-webview
class MyJavaScriptInterface
{
@SuppressWarnings("unused")
}
You need to get rid of this part.
wvbrowser.addJavascriptInterface(new MyJavaScriptInterface(),"HTMLOUT");
`class MyJavaScriptInterface
{
@SuppressWarnings("unused")
public void showHTML(String html)
{
}
`
to mono for android string html erore
Sorry mfaridi, unless you have a clear question, I cannot help you. I gave you all the pieces of the puzzle already. If you're still stuck, it's time to read up on C# and Android, follow some guides, look at some sample apps, and then make another attempt.
tanks Chris Honselaar
Thanks to all friends
code javascriptinteface
class Foo : Java.Lang.Object