NG-Cordova地理位置插件在通知栏中不显示GPS图标



我正在使用ng-cordova地理定位插件所有功能工作正常,除了问题显示GPS符号在通知栏。

当用户从移动设备启用GPS按钮时,在通知栏显示GPS符号的任何解决方案?

假设您的ng-cordova地理定位插件,只需打开gps位置。然后GPS信号应该会自动出现在通知栏中。这是标准的android操作系统。只有在你安装了不同的启动器的情况下,它可能不会显示它,这是启动器的问题,他们可能不会实时更新。

如果你的ng-cordova地理定位插件,没有打开gps,那么你需要调用以下android代码。

AlertDialog.Builder dialog = new AlertDialog.Builder(context);
            dialog.setTitle(context.getString(R.string.map_dialog_title));
            dialog.setMessage(context.getString(R.string.map_dialog_msg));
            dialog.setPositiveButton(context.getString(R.string.menu_settings),
                    new OnClickListener() {
                        @Override
                        public void onClick(DialogInterface dialog, int which) {
                             Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
                             context.startActivity(intent);
                        }
                    });
            dialog.setNegativeButton(context.getString(R.string.Cancel),
                    new OnClickListener() {
                        @Override
                        public void onClick(DialogInterface dialog, int which) {
                            dialog.dismiss();
                        }
                    });
            dialog.show();

最新更新