auschoc
asked on
Help with Basic Java Code (braces)
Hi There,
Google Android basic development
For the life of me i can't get the braces to close properly in this code, can someone please help and show how the braces should be closed.
Thanks
Google Android basic development
For the life of me i can't get the braces to close properly in this code, can someone please help and show how the braces should be closed.
Thanks
package com.button;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.webkit.WebView;
import android.widget.Button;
import android.widget.TextView;
public class button extends Activity {
Button mybutton;
TextView mylabel;
WebView mwebview;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
mybutton.setOnClickListener(new View.OnClickListener(){
public void onClick(View v){
mwebview = (WebView) findViewById(R.id.webview);
mwebview.getSettings().setJavaScriptEnabled(true);
mwebview.loadUrl("http://www.google.com");
}
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks!
could you possibly give me some advice when the following brace is needed
});
could you possibly give me some advice when the following brace is needed
});
following marks where they were opened
mybutton.setOnClickListene r1(new View.OnClickListener() 2{
public void onClick(View v) {
mwebview = (WebView) findViewById(R.id.webview) ;
mwebview.getSettings().set JavaScript Enabled(tr ue);
mwebview.loadUrl("http://www.google.com");
}
}2)1;
mybutton.setOnClickListene
public void onClick(View v) {
mwebview = (WebView) findViewById(R.id.webview)
mwebview.getSettings().set
mwebview.loadUrl("http://www.google.com");
}
}2)1;
Open in new window