I have written a subclass of WakefulBroadcastReceiver that receives the "android.intent.action.BOOT_COMPLETED" action when user device is rebooted.It is working fine in my Nexus device but not on some other devices like Samsung, Verizon etc. For those devices, I am getting a NullPointerException in onReceive() at this line Intent service = new Intent(context, MyAlarmOnBootService.class); as
java.lang.RuntimeException: Unable to start receiver com.android.myapp.receiver.MyWakefulAlarmOnBootReceiver: java.lang.NullPointerException
at android.app.ActivityThread.handleReceiver(ActivityThread.java:2244)
at android.app.ActivityThread.access$1500(ActivityThread.java:138)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1279)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4854)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:556)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at android.os.Bundle.putAll(Bundle.java:303)
at android.content.Intent.putExtras(Intent.java:5762)
at com.android.myapp.receiver.MyWakefulAlarmOnBootReceiver.onReceive(MyWakefulAlarmOnBootReceiver.java:30)
at android.app.ActivityThread.handleReceiver(ActivityThread.java:2237)
... 10 more
This is my receiver class:
public class MyWakefulAlarmOnBootReceiver extends
WakefulBroadcastReceiver {
#Override
public void onReceive(Context context, Intent intent) {
Log.d("MyApp", "receiver started after reboot");
Intent service = new Intent(context, MyAlarmOnBootService.class);//this is the line where I am getting NPE.
service.putExtras(intent.getExtras());
startWakefulService(context, service);
}
}
My Manifest file (only the parts related are shown in this file):
<?xml version="1.0" encoding="utf-8"?>
<uses-sdk
android:minSdkVersion="16"
android:targetSdkVersion="25" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<receiver android:name=".receiver.MyWakefulAlarmOnBootReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
<service
android:name=".service.MyAlarmOnBootService"
android:enabled="true" />
...
Is this related to Smart Manager app of Samsung that kills apps and alarms? If yes, how is my receiver fired? Is there some problem in the context parameter in onReceive()? Please help me. It is working fine on my Nexus 5.
Intent service = new Intent(context, MyAlarmOnBootService.class);//this is the line where I am getting NPE.
actually this is not the line. the exception raised from next line
service.putExtras(intent.getExtras());
you created new intent which has no extras, and you pass it as a parameter to putExtra() this is where you are wrong.
Related
starting on android P my app is not able to register for a GCM ID. My PushManager code looks like
try
{
GcmClient.CheckDevice(context);
GcmClient.CheckManifest(context);
String[] senderIds = GcmBroadcastReceiver.SENDER_IDS;
foreach (String id in senderIds)
{
System.Diagnostics.Debug.WriteLine("sender id = " + id);
}
GcmClient.Register(context, senderIds);
if (GcmClient.IsRegistered(context))
{
System.Diagnostics.Debug.WriteLine("push registration successfull: " +
GcmClient.GetRegistrationId(context));
}
}
catch (Exception e)
{
System.Diagnostics.Debug.WriteLine("push registration failed: " + e.Message.ToString());
}
My manifest:
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="my.app" android:versionName="1.8.5" android:versionCode="97">
<uses-sdk android:minSdkVersion="16" />
<application android:label="My app" android:icon="#mipmap/icon" android:theme="#style/Theme.App" android:hardwareAccelerated="true" android:windowSoftInputMode="stateHidden|adjustResize" android:name="android.support.multidex.MultiDexApplication">
<activity android:name="com.google.android.gms.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" android:theme="#android:style/Theme.Translucent" />
</application>
<permission android:name="com.rotogrinders.rg_lineups.permission.C2D_MESSAGE" android:protectionLevel="signature" />
<uses-permission android:name="com.rotogrinders.rg_lineups.permission.C2D_MESSAGE" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="com.android.vending.BILLING" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<permission android:name="android.permission.STATUS_BAR_SERVICE" android:protectionLevel="signature" />
<!-- For Google Play Services -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.VIBRATE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<action android:name="com.google.android.c2dm.intent.REGISTER" />
<service android:name="com.google.android.gms.analytics.AnalyticsService" android:enabled="true" android:exported="false" />
Whenever I try to register or unregister i get this error:
07-05 16:35:49.156 W/ActivityManager( 1167): Unable to start service Intent { act=com.google.android.c2dm.intent.UNREGISTER pkg=com.google.android.gsf (has extras) } U=0: not found
07-05 16:35:49.169 W/ActivityManager( 1167): Unable to start service Intent { act=com.google.android.c2dm.intent.REGISTER pkg=com.google.android.gsf (has extras) } U=0: not found
I've found that devices running older OSs register fine. the only issue I've had with this so far is with the android P preview. Any help would be appreciated.
You are likely be using an older version of GCM.
You may upgrade to GCM 11 or higher, or even better, migrate to FCM. (GCM is now deprecated)
(The latest GCM version is 15.0.1: com.google.android.gms:play-services-gcm:15.0.1)
This question already has answers here:
How to fix "Fail to connect to camera service" exception in Android emulator
(7 answers)
Closed 1 year ago.
i am developing an android app which has an flash option which is set to auto mode,but it crashes at camera.open.I have used intent to open camera
Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
int result = context.checkCallingOrSelfPermission(Manifest.permission.CAMERA);
int result2 = context.checkCallingOrSelfPermission(Manifest.permission.FLASHLIGHT);
if((result==PackageManager.PERMISSION_GRANTED) && (result2==PackageManager.PERMISSION_GRANTED)) {
cam = Camera.open();
Camera.Parameters p = cam.getParameters();
p.setFlashMode(Camera.Parameters.FLASH_MODE_ON);
cam.setParameters(p);
cam.startPreview();
}
cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, fileUri);
startActivityForResult(cameraIntent,CAMERA_CAPTURE_IMAGE_REQUEST_CODE);
}});
HERE IS LOGCAT
04-10 15:44:58.928 13248-13248/com.t4u.aapam E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.t4u.aapam, PID: 13248
java.lang.RuntimeException: Fail to connect to camera service
at android.hardware.Camera.<init>(Camera.java:529)
at android.hardware.Camera.open(Camera.java:379)
at com.t4u.aapam.ListViewDisplay$1.onItemClick(ListViewDisplay.java:402)
at android.widget.AdapterView.performItemClick(AdapterView.java:305)
at android.widget.AbsListView.performItemClick(AbsListView.java:1148)
at android.widget.AbsListView$PerformClick.run(AbsListView.java:3059)
at android.widget.AbsListView$3.run(AbsListView.java:3866)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5292)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:699)
here is my manifest file.i have added camera permission and flashlight permisssion.I have also added camera hardware permisssion
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.t4u.aapam">
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="com.telematics4u.permission.MAPS_RECEIVE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.FLASHLIGHT" />
<uses-feature android:name="android.hardware.camera" android:required="false" />
<uses-feature android:name="android.hardware.camera.flash"
android:required="false" />
<application
android:name="com.t4u.aapam.App"
android:allowBackup="true"
android:icon="#drawable/launcher_logo"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
I may be wrong(because I don't see your Manifest.xml file) but there are two solutions I can see
1) The camera cannot be connected to because it is already being used by a different application
You cannot fix that. If the camera is occupied, you can't open it.
2) You haven't requested the Camera-permission.
This can be solved. In your manifest:
<uses-permission android:name="android.permission.CAMERA"/>
And if you are targeting android 6 you have to request the permission at runtime. For that, see this link.
EDIT:
Make sure you add all of these. This will give your app access to the camera and flashlight in software and hardware.
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.FLASHLIGHT" />
<uses-feature android:name="android.hardware.camera"/>
<uses-feature android:name="android.hardware.camera.flash"/>
Using these without requiring them makes the app not work if the device (against all odds) doesn't have a camera
you should use all these permissions
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.FLASHLIGHT" />
<uses-feature android:name="android.hardware.camera" android:required="false" />
<uses-feature android:name="android.hardware.camera.flash"
android:required="false" />
Maybe this can help but i am not sure
<permission android:name="android.permission.FLASHLIGHT"
android:permissionGroup="android.permission-
group.HARDWARE_CONTROLS"
android:protectionLevel="normal"/>
I am trying to use eclipse paho library for the android app designed for my IoT project. Android app is simply sending gyroscope and accelerometer data to the broker at iot.eclipse.org.
I use the following code to establish a connection with the MQTT Server.
`public void establishMQTTConnection(){
clientId = MqttClient.generateClientId();
Log.d(TAG,clientId+"");
client =
new MqttAndroidClient(this.getApplicationContext(), "iot.eclipse.org:1883",
clientId);
// MqttConnectOptions options = new MqttConnectOptions();
//options.setUserName("aiupvrxz");
//options.setPassword("dOW0vFQzRGKA".toCharArray());
try {
token = client.connect();
token.setActionCallback(new IMqttActionListener() {
#Override
public void onSuccess(IMqttToken asyncActionToken) {
// We are connected
Log.d(TAG, "onSuccess");
}
#Override
public void onFailure(IMqttToken asyncActionToken, Throwable exception) {
// Something went wrong e.g. connection timeout or firewall problems
Log.d(TAG, "onFailure");
}
});
} catch (MqttException e) {
e.printStackTrace();
}
}`
Problem is app never establishes the connection.
I get the following error in the logcat.
05-24 12:48:20.772 10236-10236/iot.dulanga.com.androidclientv2 E/AndroidRuntime: FATAL EXCEPTION: main
java.lang.RuntimeException: Error receiving broadcast Intent { act=android.net.conn.CONNECTIVITY_CHANGE flg=0x10000010 (has extras) } in org.eclipse.paho.android.service.MqttService$NetworkConnectionIntentReceiver#41fc9348
at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:737)
at android.os.Handler.handleCallback(Handler.java:605)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4573)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
android.permission.WAKE_LOCK
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:788)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:555)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.SecurityException: Neither user 10121 nor current process has android.permission.WAKE_LOCK.
at android.os.Parcel.readException(Parcel.java:1327)
at android.os.Parcel.readException(Parcel.java:1281)
at android.os.IPowerManager$Stub$Proxy.acquireWakeLock(IPowerManager.java:432)
at android.os.PowerManager$WakeLock.acquireLocked(PowerManager.java:295)
at android.os.PowerManager$WakeLock.acquire(PowerManager.java:264)
at org.eclipse.paho.android.service.MqttService$NetworkConnectionIntentReceiver.onReceive(MqttService.java:794)
at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:728)
at android.os.Handler.handleCallback(Handler.java:605)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4573)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:788)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:555)
at dalvik.system.NativeStart.main(Native Method)
AndroidManifest....
`
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity
android:name=".MainActivity"
android:label="#string/app_name"
android:theme="#style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<service android:name="org.eclipse.paho.android.service.MqttService" >
</service>
</application>
`
Can anyone please help me to figure out the problem with my code. Thank you a lot!!!!
The exception has the key section in the middle:
Caused by: java.lang.SecurityException: Neither user 10121 nor current process has android.permission.WAKE_LOCK.
Make sure you have added the required section to the application manifest
<uses-permission android:name="android.permission.WAKE_LOCK" />
In my case i forgot add below 2 lines to Manifest:
<uses-permission android:name="android.permission.WAKE_LOCK" />
Of course you need add these permisions too:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
and in application scope add this line :
<service android:name="org.eclipse.paho.android.service.MqttService" />
I got a problem, after changing package name I can't start service via WakefulBroadcastReceiver. I'm siting with this problem and can't solve it.
My application package name is different then packages where i have my source files. The push comes to application but problem appears in these lines, when I try to startWakefulService:
public class GcmBroadcastReceiver extends WakefulBroadcastReceiver {
#Override
public void onReceive(Context context, Intent intent)
{
ComponentName comp = new ComponentName( context.getPackageName(), GcmIntentService.class.getName());
LogShower.printLogs("GcmBroadcastReceiver"+ "onReceive");
startWakefulService(context, (intent.setComponent(comp)));
setResultCode(Activity.RESULT_OK);
}
}
There is name of package of my application and then my service name, so everything as it should be.
This is the error which appears in logcat:
09-05 18:01:12.770: W/ActivityManager(2246):
Unable to start service Intent { act=com.google.android.c2dm.intent.RECEIVE flg=0x10
pkg=com.jun cmp=com.jun/com.syr.juni.pushes.GcmIntentService (has extras) } U=0: not found
Manifest looks like this:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.jun"
android:versionCode="4"
android:versionName="1.0" >
<supports-screens
android:largeScreens="true"
android:normalScreens="false"
android:requiresSmallestWidthDp="600"
android:smallScreens="false"
android:xlargeScreens="true" />
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<uses-sdk
android:minSdkVersion="17"
android:targetSdkVersion="22" />
<uses-permission android:name="android.permission.INTERNET" />
<!-- GCM requires a Google account. -->
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<!-- Keeps the processor from sleeping when a message is received. -->
<uses-permission android:name="android.permission.WAKE_LOCK" />
<!-- Creates a custom permission so only this app can receive its messages. -->
<permission
android:name="com.jun.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.jun.permission.C2D_MESSAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<!-- This app has permission to register and receive data message. -->
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<!-- Network State Permissions to detect Internet status -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<!-- Permission to vibrate -->
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.MANAGE_DOCUMENTS" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<receiver
android:name="com.syr.juni.pushes.GcmBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<!-- Receives the actual messages. -->
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<category android:name="com.jun" />
</intent-filter>
</receiver>
<service android:name="com.syr.juni.pushes.GcmIntentServiceService" />
<activity
android:name="com.syr.juni.viewbackend.ChooseScreen"
android:screenOrientation="landscape"
android:windowSoftInputMode="adjustResize" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.syr.juni.viewbackend.MainScreen"
android:exported="true"
android:screenOrientation="landscape" >
</activity>
</application>
</manifest>
I looked on similar posts, but there are answer which is already known that something is wrong with my packages.
I think you should create your own Intent instead of reusing the Intent from the parameter.
If you want to pass the extras to the service, you can clone it.
#Override
public void onReceive(Context context, Intent intent)
{
Intent service = new Intent(context, GcmIntentService.class);
service.putExtras(new Bundle(intent.getExtras())); //clone the extras
LogShower.printLogs("GcmBroadcastReceiver"+ "onReceive");
startWakefulService(context, service);
setResultCode(Activity.RESULT_OK);
}
I am successfully calling my first Activity from my AIR Native Extension, however, when I try to call the second one, I am getting the Permission Denial error (see logcat screenshot). I have tried everything I have found suggested on this site, so posting question.
02-12 15:43:22.430: I/ActivityManager(271): START {act=android.intent.action.RUN cmp=com.cno.android.map/.AddMarkerActivity (has extras) u=0} from pid 14173
02-12 15:43:22.440: W/ActivityManager(271): Permission Denial: starting Intent { act=android.intent.action.RUN cmp=com.cno.android.map/.AddMarkerActivity (has extras) } from ProcessRecord{4147a718 14173:air.TestAndroidExtension.debug/u0a75} (pid=14173, uid=10075) not exported from uid 10072
Here is my manifest:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.cno.android.map"
android:versionCode="1"
android:versionName="1.0" >
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<!-- Maps API needs OpenGL ES 2.0. -->
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
<!-- End of copy. -->
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#android:style/Theme.Black.NoTitleBar" >
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" />
<activity
android:name="com.cno.android.map.InitMapActivity"
android:label="#string/title_activity_init_map" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.cno.android.map.AddMarkerActivity"
android:exported="true" >
<intent-filter>
<action android:name="android.intent.action.RUN"/>
</intent-filter>
</activity>
</application>
Things to note:
I first tried AddMarkerActivity without any intent-filter defined. Not having ANY luck, I began experimenting with the RUN action. I have commented everything out in AddMarkerActivity except for one logcat message that says "HELLO" in the onCreate method. As you can see my Activity is not duplicated in the manifest and exported is set to true.
And finally, here is how I am calling the Activity:
public class AddAnnotationFunction implements FREFunction {
public static final String TAG = "AddAnnotationFunction";
public final static String EXTRA_MARKER = "com.cno.nativemap.functions.marker";
#Override
public FREObject call(FREContext context, FREObject[] args) {
Intent intent = new Intent();
intent.setClassName("com.cno.android.map", "com.cno.android.map.AddMarkerActivity");
Log.d(TAG, "Starting Map Activity- add marker");
intent.setAction("android.intent.action.RUN");
intent.putExtra(EXTRA_MARKER, new GeoMarker(args));
context.getActivity().startActivity(intent);
return null;
}
}