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

many to many - Django Rest Framework ManyToMany filter multiple values -

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

Java Entity Manager - JSON reader was expecting a value but found 'db' -