OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

The final local variable connection cannot be assigned. It must be blank and not using a compound assignment

  • Thread starter Thread starter DD.
  • Start date Start date
D

DD.

Guest
I have used "content" string to fetch the data from website and also in facebook integration to share the current page's data(content) on the wall, I attempted to add final in front of the declaration but that throws the following error within bundle... The final local variable connection cannot be assigned. It must be blank and not using a compound assignment. How can i correct this?

Code:
private String headerContent;
  public String html,content;
     private Facebook mFacebook;
        private AsyncFacebookRunner mAsyncRunner;
    private Bundle bundle;
    public String description,title;
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.single_list_item);

    facebook.setOnClickListener(new View.OnClickListener() {

        //@Override
        public void onClick(View v) {
            // TODO Auto-generated method stub
            Bundle params = new Bundle();



            mFacebook.dialog(Singlemenuitem.this, "feed",params,
               (DialogListener) new SampleDialogListener());            


              }

    });

    if (bundle != null)

    {

        headerContent = bundle.getString("Header_Content");
content=bundle.getString("content");

        url = bundle.getString("url");
        webView.loadUrl(url);
    }

}
<p>I have used "content" string to fetch the data from website and also in facebook integration to share the current page's data(content) on the wall, I attempted to add final in front of the declaration but that throws the following error within bundle... The final local variable connection cannot be assigned. It must be blank and not using a compound assignment.
How can i correct this?</p>

<pre><code>private String headerContent;
public String html,content;
private Facebook mFacebook;
private AsyncFacebookRunner mAsyncRunner;
private Bundle bundle;
public String description,title;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.single_list_item);

facebook.setOnClickListener(new View.OnClickListener() {

//@Override
public void onClick(View v) {
// TODO Auto-generated method stub
Bundle params = new Bundle();



mFacebook.dialog(Singlemenuitem.this, "feed",params,
(DialogListener) new SampleDialogListener());


}

});

if (bundle != null)

{

headerContent = bundle.getString("Header_Content");
content=bundle.getString("content");

url = bundle.getString("url");
webView.loadUrl(url);
}
</code></pre>

<p>}</p>
Continue reading...
 

Latest posts

Top