1

I'm trying to add an Update functionality with Button inside the app from android project. Below is the code I'm using , But I'm constantly getting error of WmversionManager (android.app.activity) WVersionManager cannot be applied to anonymous .android.view.View.OnClickListener after second @Override and third line of it where this is been underlined by Red line i.e new WVersionManager(this);

In lib folder I'm using wversionmanager- 1.2.jar and My android studio version is 2.3.3

Any help would be appreciated.

 public class about extends ActionBarActivity {

Button updateButton;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main2);

    updateButton = (Button) findViewById(R.id.button);

    updateButton.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            WVersionManager versionManager = new WVersionManager(this);
            versionManager.setVersionContentUrl("http://link_to_version_test_file/version.txt");
            versionManager.setUpdateUrl("http://link_to_updated_apk_file/latest.apk");
            versionManager.checkVersion();
        }
    });
}
}
K.Os
  • 5,123
  • 8
  • 40
  • 95

0 Answers0