Error in .java activity for telephone conversation

I just configure the phonegap application and run the HelloWorld task. But I cannot execute it correctly, since it always causes the following error.

Cannot reduce the visibility of the inherited method from DroidGap The import com.phonegap cannot be resolve 

And here is my code in MainActivity.java

 package com.example.mobile; import org.apache.cordova.DroidGap; import android.os.Bundle; import android.view.Menu; import com.phonegap.*; public class MainActivity extends DroidGap { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); super.loadUrl("file:///android_asset/www/index.html"); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.activity_main, menu); return true; } } 

I created the libs folder and added cordova-2.2.0.jar and added to the pudding. But still I can not understand the problem, kindly offer me a solution to fix it.

thanks

+6
source share
2 answers

It looks like you have 2 problems:

  • Cannot reduce the visibility of the inherited method from DroidGap - try changing the protected void onCreate to public void onCreate .
  • The import com.phonegap cannot be resolve - try deleting the line import com.phonegap.*;
+14
source

I had the same problem:
edit:
protected void onCreate(Bundle savedInstanceState)
so that:
public void onCreate(Bundle savedInstanceState)

It worked for me.

+2
source

All Articles