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
Post a Comment