android - Add module to React Native - error: cannot find symbol -


i want add simple module react native app. have errors:

:app:compiledebugjavawithjavace:\project\android\app\src\main\java\com\androiddepends\helloworld.java:23: error: cannot find symbol     intent intent = new intent(intent.action_wifi_settings);     ^   symbol:   class intent   location: class helloworld e:\project\android\app\src\main\java\com\androiddepends\helloworld.java:23: error: cannot find symbol     intent intent = new intent(intent.action_wifi_settings);                         ^   symbol:   class intent   location: class helloworld e:\project\android\app\src\main\java\com\androiddepends\helloworld.java:23: error: cannot find symbol     intent intent = new intent(intent.action_wifi_settings);                                ^   symbol:   variable intent   location: class helloworld e:\project\android\app\src\main\java\com\androiddepends\helloworld.java:24: error: cannot find symbol     if (intent.resolveactivity(getpackagemanager()) != null) {                                ^   symbol:   method getpackagemanager()   location: class helloworld 4 errors  failed 

here code:

package com.androiddepends;  import com.facebook.react.bridge.nativemodule; import com.facebook.react.bridge.reactapplicationcontext; import com.facebook.react.bridge.reactcontext; import com.facebook.react.bridge.reactcontextbasejavamodule; import com.facebook.react.bridge.reactmethod; import android.util.log;  public class helloworld extends reactcontextbasejavamodule {      public helloworld(reactapplicationcontext reactcontext) {         super(reactcontext);     }      @override     public string getname() {         return "helloworld";     }       @reactmethod     public void openwifisettings() {     intent intent = new intent(intent.action_wifi_settings);     if (intent.resolveactivity(getpackagemanager()) != null) {         startactivity(intent);     } } } 

any ideas?

you should import android sdk's intent package not found in imports section.

android.content.intent

the problem sdk's intent class not found.


Comments

Popular posts from this blog

java - Jasper subreport showing only one entry from the JSON data source when embedded in the Title band -

serialization - Convert Any type in scala to Array[Byte] and back -

SonarQube Plugin for Jenkins does not find SonarQube Scanner executable -