Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.unej.sisterforlecturer.fragment;
- import android.Manifest;
- import android.bluetooth.BluetoothAdapter;
- import android.content.Context;
- import android.content.DialogInterface;
- import android.content.Intent;
- import android.content.SharedPreferences;
- import android.content.pm.PackageManager;
- import android.os.Build;
- import android.os.Bundle;
- import android.provider.Settings;
- import android.support.annotation.NonNull;
- import android.support.annotation.Nullable;
- import android.support.design.widget.Snackbar;
- import android.support.v4.app.Fragment;
- import android.support.v7.app.AlertDialog;
- import android.text.TextUtils;
- import android.util.Log;
- import android.view.LayoutInflater;
- import android.view.View;
- import android.view.ViewGroup;
- import android.view.ViewTreeObserver;
- import android.widget.FrameLayout;
- import android.widget.ImageView;
- import android.widget.ProgressBar;
- import android.widget.TextView;
- import android.widget.Toast;
- import com.mist.android.AppMode;
- import com.mist.android.MSTAsset;
- import com.mist.android.MSTBeacon;
- import com.mist.android.MSTCentralManagerIndoorOnlyListener;
- import com.mist.android.MSTCentralManagerStatusCode;
- import com.mist.android.MSTClient;
- import com.mist.android.MSTMap;
- import com.mist.android.MSTPoint;
- import com.mist.android.MSTVirtualBeacon;
- import com.mist.android.MSTZone;
- import com.squareup.picasso.Callback;
- import com.squareup.picasso.NetworkPolicy;
- import com.squareup.picasso.Picasso;
- import com.unej.sisterforlecturer.R;
- import com.unej.sisterforlecturer.activity.LoginActivity;
- import com.unej.sisterforlecturer.activity.PresensiQRActivity;
- import com.unej.sisterforlecturer.app.MainApplication;
- import com.unej.sisterforlecturer.model.BleModel;
- import com.unej.sisterforlecturer.service.ApiService;
- import com.unej.sisterforlecturer.utils.MistManager;
- import com.unej.sisterforlecturer.utils.Server;
- import com.unej.sisterforlecturer.utils.Utils;
- import org.json.JSONArray;
- import org.json.JSONException;
- import org.json.JSONObject;
- import java.util.ArrayList;
- import java.util.Date;
- import java.util.HashMap;
- import java.util.List;
- import butterknife.BindColor;
- import butterknife.BindView;
- import butterknife.ButterKnife;
- import butterknife.Unbinder;
- import retrofit2.Call;
- import retrofit2.Response;
- /**
- * Created by anubhava on 26/03/18.
- */
- public class MapFragment extends Fragment implements MSTCentralManagerIndoorOnlyListener {
- public static final String TAG = MapFragment.class.getSimpleName();
- private static final int PERMISSION_REQUEST_FINE_LOCATION = 1;
- private static final String SDK_TOKEN = "PWbWb3Sl407lHdGK3ziNpQSeFyEDK3tX";
- private MainApplication mainApplication;
- private String sdkToken;
- private String floorPlanImageUrl = "";
- private MSTPoint mstPoint = null;
- private boolean addedMap = false;
- private double scaleXFactor;
- private double scaleYFactor;
- private boolean scaleFactorCalled;
- private float floorImageLeftMargin;
- private float floorImageTopMargin;
- public MSTMap currentMap;
- private Unbinder unbinder;
- public HashMap<String, MSTVirtualBeacon> mstVirtualBeaconMap = new HashMap<>();
- private final static String TAG_TOKEN = "token";
- SharedPreferences sharedPreferences;
- String token;
- public enum AlertType {
- bluetooth,
- network,
- location
- }
- @BindView(R.id.floorplan_bluedot)
- FrameLayout floorplanBluedotView;
- @BindView(R.id.floorplan_image)
- ImageView floorPlanImage;
- @BindView(R.id.progress_bar)
- ProgressBar progressBar;
- @BindView(R.id.txt_error)
- TextView txtError;
- @BindColor(R.color.black)
- int blackColor;
- @BindColor(R.color.zone_color)
- int zoneColor;
- @BindColor(R.color.vb_color)
- int vbColor;
- public static MapFragment newInstance(String sdkToken) {
- Bundle bundle = new Bundle();
- bundle.putString(SDK_TOKEN, sdkToken);
- MapFragment mapFragment = new MapFragment();
- mapFragment.setArguments(bundle);
- return mapFragment;
- }
- @Nullable
- @Override
- public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
- @Nullable Bundle savedInstanceState) {
- View view = inflater.inflate(R.layout.map_fragment, container, false);
- unbinder = ButterKnife.bind(this, view);
- sharedPreferences = getActivity().getSharedPreferences(LoginActivity.my_shared_preferences, Context.MODE_PRIVATE);
- token = sharedPreferences.getString(TAG_TOKEN, "");
- //progressBar.setVisibility(View.VISIBLE);
- return view;
- }
- public void Insertkehadirandosen_ble (String idruang, String token){
- ApiService apiService = Server.getClient().create(ApiService.class);
- Call<BleModel> call = apiService.getInsertkehadirandosen_ble(idruang, token);
- call.enqueue(new retrofit2.Callback<BleModel>() {
- @Override
- public void onResponse(Call<BleModel> call, Response<BleModel> response) {
- BleModel model = response.body();
- try {
- if (response.isSuccessful()) {
- System.out.println("MODEL : "+model.getMsg());
- // Toast.makeText(PresensiQRActivity.this, ""+model.getMsg(), Toast.LENGTH_SHORT).show();
- final Snackbar snackBar = Snackbar.make(getActivity().findViewById(android.R.id.content),
- model.getMsg(), Snackbar.LENGTH_INDEFINITE);
- snackBar.setAction("Dismiss", new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- android.app.AlertDialog alertDialog = new android.app.AlertDialog.Builder(getContext()).create();
- alertDialog.setIcon(R.drawable.ic_sentiment_dissatisfied);
- alertDialog.setTitle("Presensi");
- alertDialog.setMessage("Anda telah sukses melakukan presensi");
- alertDialog.setButton(android.app.AlertDialog.BUTTON_NEUTRAL, "OK",
- new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int which) {
- dialog.dismiss();
- }
- });
- alertDialog.show();
- }
- });
- View snackBarView = snackBar.getView();
- TextView textView = snackBarView.findViewById(android.support.design.R.id.snackbar_text);
- textView.setTextColor(blackColor);
- snackBar.show();
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- @Override
- public void onFailure(Call<BleModel> call, Throwable t) {
- Toast.makeText(getContext(), "Kesalahan Jaringan", Toast.LENGTH_SHORT).show();
- }
- });
- }
- @Override
- public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
- super.onViewCreated(view, savedInstanceState);
- if (getActivity() != null)
- mainApplication = (MainApplication) getActivity().getApplication();
- if (getArguments() != null)
- sdkToken = getArguments().getString(SDK_TOKEN);
- }
- @Override
- public void onStart() {
- super.onStart();
- initMISTSDK();
- }
- private void initMISTSDK() {
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && getActivity() != null &&
- getActivity().checkSelfPermission(Manifest.permission.ACCESS_FINE_LOCATION)
- != PackageManager.PERMISSION_GRANTED) {
- showLocationPermissionDialog();
- } else {
- startMistSdk();
- }
- }
- //permission dialogs
- private void showLocationPermissionDialog() {
- if (getActivity() != null) {
- AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
- builder.setTitle("This app needs location access");
- builder.setMessage("Please grant location access so this app can detect beacons in the background.");
- builder.setPositiveButton(android.R.string.ok, null);
- builder.setOnDismissListener(new DialogInterface.OnDismissListener() {
- @Override
- public void onDismiss(DialogInterface dialog) {
- requestPermissions(new String[]{Manifest.permission.ACCESS_FINE_LOCATION},
- PERMISSION_REQUEST_FINE_LOCATION);
- }
- });
- builder.show();
- }
- }
- @Override
- public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions,
- @NonNull int[] grantResults) {
- if (getActivity() != null) {
- switch (requestCode) {
- case PERMISSION_REQUEST_FINE_LOCATION:
- if (grantResults[0] == PackageManager.PERMISSION_GRANTED) {
- Log.d(TAG, "fine location permission granted !!");
- startMistSdk();
- } else {
- final AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
- builder.setTitle("Functionality limited");
- builder.setMessage("Since location access has not been granted, " +
- "this app will not be able to discover beacons when in the background.");
- builder.setPositiveButton(android.R.string.ok, null);
- builder.setOnDismissListener(new DialogInterface.OnDismissListener() {
- @Override
- public void onDismiss(DialogInterface dialog) {
- }
- });
- builder.show();
- }
- }
- }
- }
- /**
- * This method checks for the availability for Internet , Location and Bluetooth and show dialog if anything is not enabled else start the Mist SDK
- */
- private void startMistSdk() {
- BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
- if (mBluetoothAdapter != null && mBluetoothAdapter.isEnabled() && getActivity() != null &&
- Utils.isNetworkAvailable(getActivity()) && Utils.isLocationServiceEnabled(getActivity())) {
- runMISTSDK();
- } else {
- if (getActivity() != null && !Utils.isNetworkAvailable(getActivity())) {
- showSettingsAlert(AlertType.network);
- }
- if (getActivity() != null && !Utils.isLocationServiceEnabled(getActivity())) {
- showSettingsAlert(AlertType.location);
- }
- if (mBluetoothAdapter != null && !mBluetoothAdapter.isEnabled()) {
- showSettingsAlert(AlertType.bluetooth);
- }
- }
- }
- //initializing the Mist sdk with sdkToken
- private void runMISTSDK() {
- MistManager mistManager = MistManager.newInstance(mainApplication);
- mistManager.init(sdkToken, this, AppMode.FOREGROUND);
- }
- /**
- * This method show the alert as per AlertType
- *
- * @param alertType Type of Alert
- * bluetooth
- * network
- * location
- */
- private void showSettingsAlert(final AlertType alertType) {
- if (getActivity() != null) {
- final String sTitle, sButton;
- if (alertType == AlertType.bluetooth) {
- sTitle = "Bluetooth is disabled in your device. Would you like to enable it?";
- sButton = "Goto Settings Page To Enable Bluetooth";
- } else if (alertType == AlertType.network) {
- sTitle = "Network Connection is disabled in your device. Would you like to enable it?";
- sButton = "Goto Settings Page To Enable Network Connection";
- } else {
- sTitle = "Location is disabled in your device. Would you like to enable it?";
- sButton = "Goto Settings Page To Enable Location";
- }
- AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(getActivity());
- alertDialogBuilder.setMessage(sTitle)
- .setCancelable(false)
- .setPositiveButton(sButton,
- new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- dialog.cancel();
- Intent intentOpenBluetoothSettings = new Intent();
- if (alertType == AlertType.bluetooth) {
- intentOpenBluetoothSettings.setAction(Settings.ACTION_BLUETOOTH_SETTINGS);
- } else if (alertType == AlertType.network) {
- intentOpenBluetoothSettings.setAction(Settings.ACTION_WIFI_SETTINGS);
- } else if (alertType == AlertType.location) {
- intentOpenBluetoothSettings.setAction(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
- }
- startActivity(intentOpenBluetoothSettings);
- }
- });
- alertDialogBuilder.setNegativeButton("Cancel",
- new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- dialog.cancel();
- final AlertDialog.Builder builder = new
- AlertDialog.Builder(getActivity());
- builder.setTitle("Functionality won't work");
- builder.setMessage(sButton);
- builder.setPositiveButton(android.R.string.ok, null);
- builder.setOnDismissListener(new DialogInterface.OnDismissListener() {
- @Override
- public void onDismiss(DialogInterface dialog) {
- }
- });
- builder.show();
- }
- });
- AlertDialog alert = alertDialogBuilder.create();
- alert.show();
- }
- }
- @Override
- public void onBeaconDetected(MSTBeacon[] beaconArray, String region, Date dateUpdated) {
- }
- @Override
- public void onBeaconDetected(JSONArray beaconArray, Date dateUpdated) {
- }
- @Override
- public void onBeaconListUpdated(HashMap<String, HashMap<Integer, Integer[]>> beaconList, Date dateUpdated) {
- }
- /**
- * This callback provide the location of the device
- *
- * @param relativeLocation provide x,y of the device on particular map
- * @param maps
- * @param dateUpdated time stamp of the location provided
- */
- @Override
- public void onRelativeLocationUpdated(MSTPoint relativeLocation, MSTMap[] maps, Date dateUpdated) {
- if (relativeLocation != null && maps != null) {
- mstPoint = relativeLocation;
- updateRelativeLocation();
- }
- }
- private void updateRelativeLocation() {
- if (getActivity() != null) {
- getActivity().runOnUiThread(new Runnable() {
- @Override
- public void run() {
- if (currentMap != null && addedMap) {
- //(mstPoint);
- //Toast.makeText(getContext(), "WIS GA ATEK MAP2an", Toast.LENGTH_LONG).show();
- }
- }
- });
- }
- }
- //logic to show the blue dot for the location
- public void renderBlueDot(final MSTPoint point) {
- if (getActivity() != null) {
- getActivity().runOnUiThread(new Runnable() {
- @Override
- public void run() {
- if (floorPlanImage != null && floorPlanImage.getDrawable() != null && currentMap != null && point != null && addedMap) {
- float xPos = convertCloudPointToFloorplanXScale(point.getX());
- float yPos = convertCloudPointToFloorplanYScale(point.getY());
- // If scaleX and scaleY are not defined, check again
- if (!scaleFactorCalled && (scaleXFactor == 0 || scaleYFactor == 0)) {
- // setupScaleFactorForFloorplan();
- }
- float leftMargin = floorImageLeftMargin + (xPos - (floorplanBluedotView.getWidth() / 2));
- float topMargin = floorImageTopMargin + (yPos - (floorplanBluedotView.getHeight() / 2));
- floorplanBluedotView.setX(leftMargin);
- floorplanBluedotView.setY(topMargin);
- floorplanBluedotView.setVisibility(View.VISIBLE);
- }
- }
- });
- }
- }
- //calculating the scale factors
- private void setupScaleFactorForFloorplan() {
- if (floorPlanImage != null) {
- ViewTreeObserver vto = floorPlanImage.getViewTreeObserver();
- vto.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
- @Override
- public void onGlobalLayout() {
- if (floorPlanImage != null) {
- floorImageLeftMargin = floorPlanImage.getLeft();
- floorImageTopMargin = floorPlanImage.getTop();
- if (floorPlanImage.getDrawable() != null) {
- scaleXFactor = (floorPlanImage.getWidth() / (double) floorPlanImage.getDrawable().getIntrinsicWidth());
- scaleYFactor = (floorPlanImage.getHeight() / (double) floorPlanImage.getDrawable().getIntrinsicHeight());
- scaleFactorCalled = true;
- }
- }
- }
- });
- }
- }
- //converting the x point from meter's to pixel with the present scaling factor of the map rendered in the imageview
- private float convertCloudPointToFloorplanXScale(double meter) {
- return (float) (meter * this.scaleXFactor * currentMap.getPpm());
- }
- //converting the y point from meter's to pixel with the present scaling factor of the map rendered in the imageview
- private float convertCloudPointToFloorplanYScale(double meter) {
- return (float) (meter * this.scaleYFactor * currentMap.getPpm());
- }
- @Override
- public void onPressureUpdated(double pressure, Date dateUpdated) {
- }
- @Override
- public void onZoneStatsUpdated(MSTZone[] zones, Date dateUpdated) {
- }
- @Override
- public void onClientUpdated(MSTClient[] clients, MSTZone[] zones, Date dateUpdated) {
- }
- @Override
- public void onAssetUpdated(MSTAsset[] assets, MSTZone[] zones, Date dateUpdated) {
- }
- /**
- * This callback provide the detail of map user is on
- *
- * @param map Map object having details about the map
- * @param dateUpdated
- */
- @Override
- public void onMapUpdated(MSTMap map, Date dateUpdated) {
- // floorPlanImageUrl = map.getMapImageUrl();
- // Log.d(TAG, floorPlanImageUrl);
- // if (getActivity() != null && (floorPlanImage.getDrawable() == null || this.currentMap == null || !this.currentMap.getMapId().equals(map.getMapId()))) {
- // // Set the current map
- // this.currentMap = map;
- // getActivity().runOnUiThread(new Runnable() {
- // @Override
- // public void run() {
- // renderImage(floorPlanImageUrl);
- // }
- // });
- // }
- }
- /**
- * This method is used for rendering the map image using the url from the MSTMap object received from OnMapUpdated callback
- *
- * @param floorPlanImageUrl map image url
- */
- private void renderImage(final String floorPlanImageUrl) {
- Log.d(TAG, "in picasso");
- addedMap = false;
- Picasso.with(getActivity()).
- load(floorPlanImageUrl).
- networkPolicy(NetworkPolicy.OFFLINE).
- into(floorPlanImage, new Callback() {
- @Override
- public void onSuccess() {
- Log.d(TAG, "Image loaded successfully from the cached");
- addedMap = true;
- progressBar.setVisibility(View.GONE);
- if (!scaleFactorCalled) {
- setupScaleFactorForFloorplan();
- }
- }
- @Override
- public void onError() {
- Picasso.with(getActivity()).
- load(floorPlanImageUrl)
- .into(floorPlanImage, new Callback() {
- @Override
- public void onSuccess() {
- progressBar.setVisibility(View.GONE);
- addedMap = true;
- if (!scaleFactorCalled) {
- setupScaleFactorForFloorplan();
- }
- Log.d(TAG, "Image downloaded from server successfully !!");
- }
- @Override
- public void onError() {
- progressBar.setVisibility(View.GONE);
- Log.d(TAG, "Could not download the image from the server");
- }
- });
- }
- });
- }
- //provides the list of vBeacons atatched to your floor plan
- @Override
- public void onVirtualBeaconListUpdated(MSTVirtualBeacon[] virtualBeacons, Date dateUpdated) {
- mstVirtualBeaconMap.clear();
- for (MSTVirtualBeacon vb : virtualBeacons) {
- mstVirtualBeaconMap.put(vb.getVbid(), vb);
- }
- }
- //called when notifications are received on entering a zone or passing by a vBecaon
- @Override
- public void onNotificationReceived(Date dateReceived, String message) {
- Log.d(TAG, "notification recieved!!");
- Log.d(TAG, "Message => " + message);
- if (!Utils.isEmptyString(message)) {
- try {
- JSONObject notificationJSONObject = new JSONObject(message);
- String type = notificationJSONObject.getString("type");
- if (type.equalsIgnoreCase("zone-event-vb")) {
- JSONObject messageObject = notificationJSONObject.optJSONObject("message");
- if (messageObject != null) {
- String proximity = messageObject.getString("proximity");
- if (proximity.equals("near") || proximity.equals("immediate")) {
- String messageToBeDisplayed = "";
- String extra = messageObject.getString("Extra");
- String vbID = messageObject.optString("vbID");
- if (mstVirtualBeaconMap.containsKey(vbID)) {
- MSTVirtualBeacon vb = mstVirtualBeaconMap.get(vbID);
- messageToBeDisplayed = vb.getMessage();
- }
- if (TextUtils.isEmpty(messageToBeDisplayed)) {
- if (TextUtils.isEmpty(extra)) {
- messageToBeDisplayed = "You're near the Anonymous VB";
- } else {
- if (proximity.equals("near")) {
- String dekat = "dekat dengan";
- messageToBeDisplayed = String.format("Anda %1$s %2$s", dekat, extra);
- }
- }
- }
- showNotification(false, messageToBeDisplayed);
- } else if (proximity.equals("far")) {
- String messageToBeDisplayed = "";
- String extra = messageObject.getString("Extra");
- String vbID = messageObject.optString("vbID");
- if (mstVirtualBeaconMap.containsKey(vbID)) {
- MSTVirtualBeacon vb = mstVirtualBeaconMap.get(vbID);
- messageToBeDisplayed = vb.getMessage();
- }
- if (TextUtils.isEmpty(messageToBeDisplayed)) {
- if (TextUtils.isEmpty(extra)) {
- messageToBeDisplayed = "You're far from the Anonymous VB";
- } else {
- messageToBeDisplayed = String.format("You're %1$s %2$s", proximity, extra);
- }
- }
- //action can be taken according to the need in case of far beacon
- }
- }
- } else if (type.equalsIgnoreCase("zones-events")) {
- JSONObject messageObject = notificationJSONObject.optJSONObject("message");
- if (messageObject != null) {
- String trigger = messageObject.getString("Trigger");
- if (trigger.equalsIgnoreCase("in")) {
- String messageToBeDisplayed = "";
- String extra = messageObject.getString("Extra");
- //Insertkehadirandosen_ble( extra,token);//sini
- Insertkehadirandosen_ble("B34BE141-7FB5" +
- "-457B-B8E9-C2BE4806CACC",token);//sini
- if (TextUtils.isEmpty(extra)) {
- messageToBeDisplayed = "You're in the Anonymous Zone";
- } else {
- messageToBeDisplayed = String.format("Anda sedang berada di %1$s %2$s", trigger, extra);
- }
- showNotification(true, messageToBeDisplayed);
- }
- if (trigger.equalsIgnoreCase("out")) {
- String messageToBeDisplayed = "";
- String extra = messageObject.getString("Extra");
- if (TextUtils.isEmpty(extra)) {
- messageToBeDisplayed = "You left the Anonymous Zone";
- } else {
- messageToBeDisplayed = String.format("Anda sedang meninggalkan %1$s", extra);
- }
- showNotification(true, messageToBeDisplayed);
- }
- }
- }
- } catch (JSONException e) {
- e.printStackTrace();
- }
- }
- try {
- JSONObject jsonObject = new JSONObject(message);
- JSONObject msgObj = jsonObject.getJSONObject("message");
- String UserID = msgObj.getString("UserID");
- Log.e("TAG", "UserID ==> " + UserID);
- } catch (JSONException e) {
- e.printStackTrace();
- }
- }
- //showing the notifications
- private void showNotification(boolean isZone, String message) {
- final Snackbar snackBar = Snackbar.make(getActivity().findViewById(android.R.id.content),
- message, Snackbar.LENGTH_INDEFINITE);
- snackBar.setAction("Dismiss", new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- android.app.AlertDialog alertDialog = new android.app.AlertDialog.Builder(getContext()).create();
- alertDialog.setIcon(R.drawable.ic_sentiment_dissatisfied);
- alertDialog.setTitle("Presensi");
- alertDialog.setMessage("Anda telah sukses melakukan presensi");
- alertDialog.setButton(android.app.AlertDialog.BUTTON_NEUTRAL, "OK",
- new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int which) {
- dialog.dismiss();
- }
- });
- alertDialog.show();
- }
- });
- View snackBarView = snackBar.getView();
- TextView textView = snackBarView.findViewById(android.support.design.R.id.snackbar_text);
- textView.setTextColor(blackColor);
- if (isZone) {
- snackBarView.setBackgroundColor(zoneColor);
- } else {
- snackBarView.setBackgroundColor(vbColor);
- }
- snackBar.show();
- }
- @Override
- public void onClientInformationUpdated(String clientName) {
- }
- @Override
- public void onReceivedSecret(String orgName, String orgID, String sdkSecret, String error) {
- }
- @Override
- public void receivedLogMessageForCode(String message, MSTCentralManagerStatusCode code) {
- }
- @Override
- public void receivedVerboseLogMessage(String message) {
- }
- //callback for error
- @Override
- public void onMistErrorReceived(String message, Date date) {
- progressBar.setVisibility(View.GONE);
- txtError.setVisibility(View.VISIBLE);
- txtError.setText(message);
- }
- @Override
- public void onMistRecommendedAction(String message) {
- }
- @Override
- public void onDestroyView() {
- super.onDestroyView();
- unbinder.unbind();
- MistManager.newInstance(mainApplication).destroy();
- }
- @Override
- public void onStop() {
- super.onStop();
- //disconnecting the Mist SDK
- MistManager.newInstance(mainApplication).disconnect();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement